Skip to main content

Generate a random MongoDB ObjectId.

Project description


This is a pretty simple project without any outlandish goals. Occasionally I needed a MongoDB ObjectID for a unit test. This saves a query or visiting a website. I also wanted to learn more about writing & deploying Python packages.




Python 2.7 and 3.2+. See .travis.yml here for the full breakdown.


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
$ random_object_id -l

Project details

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
random_object_id-1.0.4-py2.py3-none-any.whl (4.4 kB) Copy SHA256 hash SHA256 Wheel py2.py3
random-object-id-1.0.4.tar.gz (2.9 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page