生成一个随机的MongoDB对象ID。
random-object-id的Python项目详细描述
动机
这是一个非常简单的项目,没有任何古怪的目标。有时候我需要一个MongoDB对象来进行单元测试。这将保存查询或访问网站。我还想了解有关编写和部署python包的更多信息。
依赖关系
没有。
支持
Python2.7和3.2+。请参见.travis.ymlhere了解完整的分解。
安装
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("...")
示例
$ random_object_id 55348611a56c10449ab80a4f $ random_object_id -l ObjectId("553486125ed592a10c4e8e6b")