{ "info": { "author": "Joe Drumgoole", "author_email": "joe@joedrumgoole.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3.6" ], "description": "# mongodbrdg - The MongoDB Random Data Generator\nData generator for generating repeatable random data suitable for use in \nMongoDB databases. The data is designed to be random but self consistent. So \nuser IDs increase consistently, session docs for login and logout are correctly\nordered and sequence of login and logout events are also temporarily ordered.\n\nWe also ensure that session events happen only after the registered date for\nthe user. \n\nWe generate one collection by default `USERS/profiles`. Users can generate\na second collection by specifying the `--session` argument. The sessions \ncollection is called `USERs.sessions`.\n\n## Installation\n\nTo install use `pip` or `pipenv`. You must be using python 3.6 or greater. \n\n```shell script\n$ pip install mongodbrdg\nCollecting mongodbrdg\n...\nSuccessfully built mongodbrdg\nInstalling collected packages: mongodbrdg\nSuccessfully installed mongodbrdg-0.2a1\n```\n\n## Running mongodbrdg\n\n`mongodbrdg` installs on your python path and can be run by invoking\n```shell script\n$ mongodbrdg\n```\n\nIt expects to have a [mongod](https://docs.mongodb.com/manual/reference/program/mongod/)\nrunning on the default port (27017). You can point the program at a different\n`mongod` and/or cluster by using the `--mongodb` argument.\n\n# Command line arguments\n```shell script\n$ mongodbrdg -h\nusage: mongodbrdg [-h] [--mongodb MONGODB] [--database DATABASE]\n [--collection COLLECTION] [--idstart IDSTART]\n [--idend IDEND] [--maxfriends MAXFRIENDS] [--seed SEED]\n [--drop] [--report] [--session {none,random,count}]\n [--sessioncount SESSIONCOUNT]\n [--sessioncollection SESSIONCOLLECTION]\n [--bucketsize BUCKETSIZE] [--stats] [-locale LOCALE]\n [--batchsize BATCHSIZE]\n\nmongodbrdg 0.4.5. Generate random JSON data for MongoDB (requires python 3.6).\n\noptional arguments:\n -h, --help show this help message and exit\n --mongodb MONGODB MongoDB host: [default: mongodb://localhost:27017]\n --database DATABASE MongoDB database name: [default: USERS]\n --collection COLLECTION\n Default collection for random data:[default: profiles]\n --idstart IDSTART The starting value for a user_id range [default: 0]\n --idend IDEND The end value for a user_id range: [default: 10]\n --maxfriends MAXFRIENDS\n Specify max number of friend to include in profile\n [default: 0]\n --seed SEED Use this seed value to ensure you always get the same\n data\n --drop Drop data before creating a new set [default: False]\n --report send all generated JSON to the screen [default: False]\n --session {none,random,count}\n Generate a sessions collection [default: none do not\n generate]\n --sessioncount SESSIONCOUNT\n Default number of sessions to generate.Gives the\n random bound for random sessions [default: 5]\n --sessioncollection SESSIONCOLLECTION\n Name of sessions collection: [default: sessions]\n --bucketsize BUCKETSIZE\n Bucket size for insert_many [default: 1000]\n --stats Report time to insert data\n -locale LOCALE Locale to use for data: [default: en]\n --batchsize BATCHSIZE\n How many docs to insert per batch: [default: 1000]\n$```\n\n# Example Data\nThe random data that is random but looks real. We use the python [mimesis](https://mimesis.readthedocs.io/) package\nfor this purpose. There are two separate collections that can be created. The\nfirst is the `profiles` collection which contains example user records. A typical\nexample document is:\n\n```json\n{\n \"first_name\": \"Donnetta\",\n \"last_name\": \"Page\",\n \"gender\": \"FEMALE\",\n \"company\": \"Syntel\",\n \"email\": \"Donnetta.Page@syntel.rio\",\n \"registered\": \"2010-06-09 11:06:05.882643\",\n \"user_id\": 0,\n \"country\": \"United States\",\n \"city\": \"Hayward\",\n \"phone\": \"1-171-738-1641\",\n \"location\": {\n \"type\": \"Point\",\n \"coordinates\": [\n 164.393576,\n 59.535072\n ]\n },\n \"language\": \"Dari\",\n \"interests\": [\n \"Reading\",\n \"politics\"\n ]\n}\n```\n\nThe second is the the `sessions` document.\nIf the user asks for sessions to be generated the we will generate a seperate\ncollection keyed by the `user_id` and generate a collection of session\ndocuments.\n\nSession documents look like this:\n```json\n{\n \"user_id\": 0,\n \"login\": \"2021-07-02 22:30:28.790370\"\n}\n\n{\n \"user_id\": 0,\n \"logout\": \"2021-07-04 00:15:29.543370\"\n}\n```\nThey always come in matched pairs. A `login` document and a `logout` document. These\ndocs are keyed by the `user_id` field which always matches to a valid profile\ndoc.\n\n# Example Usage\n\nSome simple examples of the program in action.\n## Create one random doc:\nThe parameter `--idstart` defaults to zero so this generates a python\n[range](https://docs.python.org/3/library/functions.html#func-range) of\n0..1 which creates one document.\n\n```shell script\n$ mongodbrdg --idend 1\nInserted 1 user docs into USERS.profiles\n$\n```\n## Create a doc and output it\nWe use the `--report` object to spit out the JSON to stdout. Note that \nalthough we generate [datetime](https://docs.python.org/3/library/datetime.html) \nobjects internally for insertion we convert these to a string representation \nfor output to JSON.\n\n```shell script\n$ mongodbrdg --idend 1 --report\n{\n \"first_name\": \"Patrick\",\n \"last_name\": \"David\",\n \"gender\": \"MALE\",\n \"company\": \"Danaher\",\n \"email\": \"Patrick.David@danaher.info\",\n \"registered\": \"2034-07-08 12:06:05.728825\",\n \"user_id\": 0,\n \"country\": \"United States\",\n \"city\": \"Yucca Valley\",\n \"phone\": \"(065) 868-4054\",\n \"location\": {\n \"type\": \"Point\",\n \"coordinates\": [\n -42.659858,\n -2.631433\n ]\n },\n \"language\": \"Malagasy\",\n \"interests\": []\n}\nInserted 1 user docs into USERS.profiles\n```\n\n## Create many docs\n```shell script\n$ mongodbrdg --idend 1000\nInserted 1000 user docs into USERS.profiles\n$\n```\n\n## Create the same data set every time\n\nUse the `--seed` option to specify a random integer seed. Using the same \nseed ensures that the identical set of random data will be generated\nevery time.\n\n\n```shell script\n mongodbrdg --idend 1 --report --seed 123\n{\n \"first_name\": \"Billy\",\n \"last_name\": \"Evans\",\n \"gender\": \"MALE\",\n \"company\": \"Antec\",\n \"email\": \"Billy.Evans@antec.lt\",\n \"registered\": \"2018-05-03 13:17:06.879234\",\n \"user_id\": 0,\n \"country\": \"United States\",\n \"city\": \"Battle Ground\",\n \"phone\": \"1-288-353-0157\",\n \"location\": {\n \"type\": \"Point\",\n \"coordinates\": [\n -83.63622,\n 48.41215\n ]\n },\n \"language\": \"Dhivehi\",\n \"interests\": [\n \"Darts\",\n \"Golf\",\n \"politics\",\n \"Board gaming\",\n \"Football\"\n ]\n}\nInserted 1 user docs into USERS.profiles\n```\n\n## Generate a user record and associated session records\n\nWe specify that we want session records with the ``--session count`` arg. This\ntells use to generate a specific number of sessions. We then specify the number\nof sessions with `--sessioncount`. A single session generates a `login` and a \n`logout` document. For any given session the `logout` session always happens\nafter the `login` session.\n\nYou can specify the following arguments to `--session`:\n\n * `count` : generate a specific number of sessions per user\n * `random` : generate a random number of sessions between 0 and `--sessioncount`\n * `none` (default) : Do not generate session data\n \n```shell script\n$ mongodbrdg --idend 1 --report --session count --sessioncount 1\n{\n \"first_name\": \"Jetta\",\n \"last_name\": \"Cline\",\n \"gender\": \"FEMALE\",\n \"company\": \"Integra Design\",\n \"email\": \"Jetta.Cline@integradesign.aero\",\n \"registered\": \"2029-05-09 19:40:34.866333\",\n \"user_id\": 0,\n \"country\": \"United States\",\n \"city\": \"Topeka\",\n \"phone\": \"(724) 108-6398\",\n \"location\": {\n \"type\": \"Point\",\n \"coordinates\": [\n -154.636317,\n 34.894447\n ]\n },\n \"language\": \"Malayalam\",\n \"interests\": [\n \"Football\",\n \"skydiving\",\n \"Running\",\n \"politics\",\n \"Triathlon\"\n ]\n}\n{\n \"user_id\": 0,\n \"login\": \"2029-05-10 23:28:34.980333\"\n}\n{\n \"user_id\": 0,\n \"logout\": \"2029-05-12 01:36:35.248333\"\n}\nInserted 1 user docs into USERS.profiles\nInserted 2 session docs into USERS.sessions\n$\n```\n\n## Adding Friends to a user\n\nFor data requiring a graph structure we can add a friends field to the profile\nusing the `--maxfriends` field. The default for `--maxfriends` field is 0. \nWhen the value is zero the field is omitted. For any value greater than zero we\ngenerate 0..`maxfriends` friends for each user. The friends are selected at\nrandom from `--idstart` to `--idend`.\n\n```shell script\n$ mongodbrdg --idend 10 --maxfriends 2 --report\n{\n \"first_name\": \"Lavona\",\n \"last_name\": \"Rodriquez\",\n \"gender\": \"FEMALE\",\n \"company\": \"Atari\",\n \"email\": \"Lavona.Rodriquez@atari.ua\",\n \"registered\": \"2005-08-10 22:02:45.687955\",\n \"user_id\": 0,\n \"country\": \"United States\",\n \"city\": \"Watsonville\",\n \"phone\": \"1-407-350-4386\",\n \"location\": {\n \"type\": \"Point\",\n \"coordinates\": [\n -26.850068,\n -56.593144\n ]\n },\n \"language\": \"Japanese\",\n \"friends\": [\n 1,\n 2\n ],\n \"interests\": [\n \"Triathlon\"\n ]\n}\n...\n\n \"first_name\": \"Enrique\",\n \"last_name\": \"Dennis\",\n \"gender\": \"MALE\",\n \"company\": \"ABX Air\",\n \"email\": \"Enrique.Dennis@abxair.consulting\",\n \"registered\": \"2019-02-17 00:09:41.859429\",\n \"user_id\": 9,\n \"country\": \"United States\",\n \"city\": \"Hemet\",\n \"phone\": \"159-721-4912\",\n \"location\": {\n \"type\": \"Point\",\n \"coordinates\": [\n -32.912016,\n -11.078288\n ]\n },\n \"language\": \"Tsonga\",\n \"friends\": [\n 1,\n 7\n ],\n \"interests\": [\n \"Running\",\n \"Darts\"\n ]\n}\nInserted 10 user docs into USERS.profiles\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jdrumgoole/mongdb_random_data_generator", "keywords": "Random Data MongoDB", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "mongodbrdg", "package_url": "https://pypi.org/project/mongodbrdg/", "platform": "", "project_url": "https://pypi.org/project/mongodbrdg/", "project_urls": { "Homepage": "https://github.com/jdrumgoole/mongdb_random_data_generator", "Issues": "https://github.com/jdrumgoole/mongodb_random_data_generator/issues", "github src": "https://github.com/jdrumgoole/mongodb_random_data_generator" }, "release_url": "https://pypi.org/project/mongodbrdg/0.4.6/", "requires_dist": null, "requires_python": ">=3.6", "summary": "MongoDB RDG - Random data generator for MongoDB", "version": "0.4.6" }, "last_serial": 5879683, "releases": { "0.2a1": [ { "comment_text": "", "digests": { "md5": "c2b61b7cce44b375313eaca887de68e4", "sha256": "08d5a6d3e55d0be026d54f5a7e974b9b3448c5a671434838a27fcfd83210d306" }, "downloads": -1, "filename": "mongodbrdg-0.2a1.tar.gz", "has_sig": false, "md5_digest": "c2b61b7cce44b375313eaca887de68e4", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.7", "size": 7128, "upload_time": "2019-09-22T22:53:00", "url": "https://files.pythonhosted.org/packages/42/89/b0e7526a43cf08fa1d67cbbeede7874fddc027f61173a4f483275b6fd81a/mongodbrdg-0.2a1.tar.gz" } ], "0.2a2": [ { "comment_text": "", "digests": { "md5": "a8e4547f22454c6f0e7333b2562a5404", "sha256": "df324cd2596892169cc9ebff1ca7ce67bd65caa3f3e0ac212572f6ba9708dde2" }, "downloads": -1, "filename": "mongodbrdg-0.2a2.tar.gz", "has_sig": false, "md5_digest": "a8e4547f22454c6f0e7333b2562a5404", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.7", "size": 7375, "upload_time": "2019-09-22T22:57:56", "url": "https://files.pythonhosted.org/packages/e9/1a/f3f895187a4a372236b4e62fbfce8382522e087209d9b423667f89006140/mongodbrdg-0.2a2.tar.gz" } ], "0.2a3": [ { "comment_text": "", "digests": { "md5": "e1c0d79ca255ad18689235f000bc2461", "sha256": "13ad3b552ec13d93e666e98d6e33bdedd22a09b66bab9031eaaf43ab4e1d7a65" }, "downloads": -1, "filename": "mongodbrdg-0.2a3.tar.gz", "has_sig": false, "md5_digest": "e1c0d79ca255ad18689235f000bc2461", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.7", "size": 7645, "upload_time": "2019-09-23T13:14:08", "url": "https://files.pythonhosted.org/packages/d0/ab/0314a7e489dcfda70d949f08d31fc914c8aa325b7bc21e83c3e500b0ca23/mongodbrdg-0.2a3.tar.gz" } ], "0.2a4": [ { "comment_text": "", "digests": { "md5": "1c089ae6aed009a9017b26e858b59dbd", "sha256": "11a8600041d883c7d47ea0bf3ef1431e238eb1174855e91c1b715565926c3a5c" }, "downloads": -1, "filename": "mongodbrdg-0.2a4.tar.gz", "has_sig": false, "md5_digest": "1c089ae6aed009a9017b26e858b59dbd", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.7", "size": 8772, "upload_time": "2019-09-23T13:20:00", "url": "https://files.pythonhosted.org/packages/ef/01/ffdb403037946189d826bb62825229a4b0f0b19b454b4d15353473b44ab8/mongodbrdg-0.2a4.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "d0a100caa295bf045d691167a426f833", "sha256": "f40162bd80208d88dba94b493ed4a6bc4958bae3c2e11093dbd472aea102d2ac" }, "downloads": -1, "filename": "mongodbrdg-0.3.tar.gz", "has_sig": false, "md5_digest": "d0a100caa295bf045d691167a426f833", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.7", "size": 7365, "upload_time": "2019-09-22T22:58:56", "url": "https://files.pythonhosted.org/packages/9a/b7/327578f28e10f3c573b1635ee4866e4e4f74b68c082258ad52d7843a90a1/mongodbrdg-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "8596238bbd96dbd32408aa3bde0c529b", "sha256": "1dd2f1e724b16601a4e2ecaa720272642d0a69de1e23e81a0210817c063e3d9d" }, "downloads": -1, "filename": "mongodbrdg-0.4.tar.gz", "has_sig": false, "md5_digest": "8596238bbd96dbd32408aa3bde0c529b", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.7", "size": 8763, "upload_time": "2019-09-23T13:27:14", "url": "https://files.pythonhosted.org/packages/c2/3b/f3285accd80e065b2cc52ed56a0c661fb765f47432806d92cd03d29b9c13/mongodbrdg-0.4.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "1b4ec97a13ae716a61edcab824a72de7", "sha256": "d5b638de5e3805c4b59ed69dc8dd9f99a76421d0d1907cb73d67c4fa7a7203f8" }, "downloads": -1, "filename": "mongodbrdg-0.4.1.tar.gz", "has_sig": false, "md5_digest": "1b4ec97a13ae716a61edcab824a72de7", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.7", "size": 8725, "upload_time": "2019-09-23T13:31:58", "url": "https://files.pythonhosted.org/packages/d5/3d/3735ca7cd7ca0ec601951057b9766485aae8b12f58b42dd722da6132994a/mongodbrdg-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "2c6541f41229f30939bbd5d7794d5f6e", "sha256": "19d476997b21558e25461c6369fe4b229efc97a99e0981edcaa1b5edd1c86a0a" }, "downloads": -1, "filename": "mongodbrdg-0.4.2.tar.gz", "has_sig": false, "md5_digest": "2c6541f41229f30939bbd5d7794d5f6e", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.7", "size": 8730, "upload_time": "2019-09-23T13:34:36", "url": "https://files.pythonhosted.org/packages/24/5b/d2c8d31e79cd3e265dbc23a985df817dad11740bf3167c678f746d2e2ff4/mongodbrdg-0.4.2.tar.gz" } ], "0.4.3": [ { "comment_text": "", "digests": { "md5": "3f6816b63d9e7a5d4e90cdd1c4bbc8f2", "sha256": "a55552aa1502186dac5d2538f8b0c085852825ca82385a4a515be5840f3e5324" }, "downloads": -1, "filename": "mongodbrdg-0.4.3.tar.gz", "has_sig": false, "md5_digest": "3f6816b63d9e7a5d4e90cdd1c4bbc8f2", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.7", "size": 8989, "upload_time": "2019-09-23T13:42:44", "url": "https://files.pythonhosted.org/packages/f3/aa/3cb0ce1f46c6f20e884675d9b0345a821532a158f84452d9a7330a424805/mongodbrdg-0.4.3.tar.gz" } ], "0.4.4": [ { "comment_text": "", "digests": { "md5": "bb43d955149274fda1d0c50ffaa4095b", "sha256": "bc86ce1d833ea76e3913e6c1d24af5eee47ec24dce2fda826edbcd5914455b97" }, "downloads": -1, "filename": "mongodbrdg-0.4.4.tar.gz", "has_sig": false, "md5_digest": "bb43d955149274fda1d0c50ffaa4095b", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.7", "size": 8861, "upload_time": "2019-09-23T15:55:38", "url": "https://files.pythonhosted.org/packages/cb/4f/6bad45f39129384689c1e4683cf4af86aa904b66c978468dc51467e5595f/mongodbrdg-0.4.4.tar.gz" } ], "0.4.5": [ { "comment_text": "", "digests": { "md5": "de297b8ec783854c92b302f6c9e9a6d7", "sha256": "29c028dcacb135048556b204e88e3e22f10e82d5bf5933ec6a7638663dbbe6a9" }, "downloads": -1, "filename": "mongodbrdg-0.4.5.tar.gz", "has_sig": false, "md5_digest": "de297b8ec783854c92b302f6c9e9a6d7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10863, "upload_time": "2019-09-24T11:58:14", "url": "https://files.pythonhosted.org/packages/1f/f5/a57afddad5f79611f2527b00b0a8b699402773a262dbd9f443baa653825f/mongodbrdg-0.4.5.tar.gz" } ], "0.4.6": [ { "comment_text": "", "digests": { "md5": "f2a77b1a3c16a910f08481d50f593327", "sha256": "72261dfb1ce60166ed5efe75125c0457d250f8a20af66c0bc205e05f00b96f69" }, "downloads": -1, "filename": "mongodbrdg-0.4.6.tar.gz", "has_sig": false, "md5_digest": "f2a77b1a3c16a910f08481d50f593327", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 11014, "upload_time": "2019-09-24T13:29:09", "url": "https://files.pythonhosted.org/packages/73/46/cddbf9801aa0a34eb49ebfec08a45e150fb91d721d53c884db405b587cdc/mongodbrdg-0.4.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f2a77b1a3c16a910f08481d50f593327", "sha256": "72261dfb1ce60166ed5efe75125c0457d250f8a20af66c0bc205e05f00b96f69" }, "downloads": -1, "filename": "mongodbrdg-0.4.6.tar.gz", "has_sig": false, "md5_digest": "f2a77b1a3c16a910f08481d50f593327", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 11014, "upload_time": "2019-09-24T13:29:09", "url": "https://files.pythonhosted.org/packages/73/46/cddbf9801aa0a34eb49ebfec08a45e150fb91d721d53c884db405b587cdc/mongodbrdg-0.4.6.tar.gz" } ] }