Skip to main content

Generate a random MongoDB ObjectId.

Project description

Random ObjectId

Wheel Status

Motivation

This is a toy project without any outlandish goals. Occasionally I needed a MongoDB ObjectID for a unit test. This saves a DB query, starting mongo locally, writing more than a line of Python, or visiting a website. I also wanted to learn more about writing & deploying Python packages.

Dependencies

None

Supports

py36+. See GitHub workflow here.

Installation

$ pip install random-object-id

Usage

$ 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'

Examples

$ random_object_id
55348611a56c10449ab80a4f
$ random_object_id -l
ObjectId("553486125ed592a10c4e8e6b")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

random_object_id-2.0.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

random_object_id-2.0.0-py2.py3-none-any.whl (3.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file random_object_id-2.0.0.tar.gz.

File metadata

  • Download URL: random_object_id-2.0.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10

File hashes

Hashes for random_object_id-2.0.0.tar.gz
Algorithm Hash digest
SHA256 52800a90ec30e5d6a1e5e1f29a1295028816ac5a673793ec95f2e338c7dbab61
MD5 46725facdbc5b0c14470717e8f29b053
BLAKE2b-256 f90aa82b6822abd80e0bef2972cf81077993e311af238f1ad3cf144316eb9a4b

See more details on using hashes here.

File details

Details for the file random_object_id-2.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: random_object_id-2.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10

File hashes

Hashes for random_object_id-2.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9fff59bf6c444601d2033c0d28cbee7ec5c11ae8e978081f706d7be16fd96299
MD5 343e69adf709c520fcc704100da40cbb
BLAKE2b-256 d1315c5e47cd0c06b074dc1bd17eff38a6700dc3c1b9f7a501767e35efcd7a4d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page