生成一个随机的MongoDB ObjectId。
项目描述
随机ObjectId
动机
这是一个没有任何宏伟目标的小项目。偶尔我需要一个MongoDB ObjectID来进行单元测试。这可以节省数据库查询、启动本地的mongo
、写超过一行Python代码或访问网站的时间。我还想了解更多关于编写和部署Python包的知识。
依赖项
无
支持
py36+. 请参阅GitHub工作流程此处。
安装
$ pip install random-object-id
用法
$ random_object_id -h
usage: random_object_id [-h] [-l]
Generate a random MongoDB ObjectId
optional arguments:
-h, --help show this help message and exit
-l, --longform prints the ID surrounded by ObjectId("...")
from random_object_id import generate
generate() # => '5ecd3bbf875e60b4166f6699'
示例
$ random_object_id
55348611a56c10449ab80a4f
$ random_object_id -l
ObjectId("553486125ed592a10c4e8e6b")
项目详情
关闭
random_object_id-2.0.0.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 52800a90ec30e5d6a1e5e1f29a1295028816ac5a673793ec95f2e338c7dbab61 |
|
MD5 | 46725facdbc5b0c14470717e8f29b053 |
|
BLAKE2b-256 | f90aa82b6822abd80e0bef2972cf81077993e311af238f1ad3cf144316eb9a4b |
关闭
random_object_id-2.0.0-py2.py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 9fff59bf6c444601d2033c0d28cbee7ec5c11ae8e978081f706d7be16fd96299 |
|
MD5 | 343e69adf709c520fcc704100da40cbb |
|
BLAKE2b-256 | d1315c5e47cd0c06b074dc1bd17eff38a6700dc3c1b9f7a501767e35efcd7a4d |