A small and basic package to create randomized MongoDB documents and trivial load.
Project description
# MongoDataRandomizer
This is a simple data randoizer to load up a MongoDB database with data.
## Installation
### From PyPI
* `pip install MongoRandomizer`
### From Source
* Download source code
* `cd` to the download directory
* Run `pip install --editable .`
## Use
### Help
```
graboskycMBP:~ graboskyc$ MongoRandomizer -h
usage: MongoRandomizer [-h] [-c CS] [-t T] [-b B] [-m M] [-p P] [-w WC] [-j]
[-g]
task
CLI Tool for continually writing random data to a MongoDB database for testing
purposes
positional arguments:
task clean, insert, insertAndUpdate, read, everything
optional arguments:
-h, --help show this help message and exit
-c CS server connection string
-t T threads to use, if left off, use 10
-b B blocksize to use. if not inclided, use 1000
-m M max blocks to use. if not inclided, use 1000
-p P additional chars of padding to increase document size
-w WC write concern to use. if blank, none used
-j, --journaling if omitted, false. if flag enabled, journal
-g, --geo if omitted, use customer data. if flag enabled push
geographic data
```
### Random Inserts
```
graboskycMBP:~ graboskyc$ MongoRandomizer -c mongodb://localhost -t 5 -b 500 -p 10 -w 1 -j insert
About to enter data in:
Threads: 5
DB: demodb
Collection: democollection
Blocksize: 1000
Max Blocks: 500
Write Concern: 1
Journaling: True
This process will continue until you press control+c or break
```
### Sample Document
```
{
"_id" : ObjectId("5b7db58ecc39345cebc78f67"),
"prescriptions" : [
"Drug water adult.",
"Enjoy month.",
"Just always wind summer.",
"Bad street me.",
"Assume.",
"Section.",
"Forward nearly.",
"Town community boy.",
"Vote major.",
"Walk.",
"Left night receive.",
"Relationship speak.",
"Affect nearly.",
"Present star special.",
"Employee instead.",
"Kid foot direction poor.",
"Determine law."
],
"accountNumber" : 48,
"padding" : "aaaaaaaaaa",
"address" : "847 Ferguson Rd.",
"payment" : 60,
"occupation" : "Aid worker",
"singupDate" : ISODate("2018-08-22T19:11:55.442Z"),
"copay" : 20,
"notes" : "Crime evening nation artist blue far fast generation. Play list range none before night everyone. Doctor make score around.",
"zipcode" : "43418",
"state" : "WY",
"fullname" : "Donna Webster",
"deductible" : 300
}
```
### Sample Geo Document
```
{
"_id" : ObjectId("5b9fd129cc39341758236d80"),
"padding" : "",
"notes" : "Wait mean performance view billion plan civil this. Cup prevent season.\nEffect thought while get market war wife oil.",
"name" : "Mr. Antonio Salas MD",
"location" : {
"type" : "Point",
"coordinates" : [
-73.59354663520122,
42.00216814289992
]
}
}
```
This is a simple data randoizer to load up a MongoDB database with data.
## Installation
### From PyPI
* `pip install MongoRandomizer`
### From Source
* Download source code
* `cd` to the download directory
* Run `pip install --editable .`
## Use
### Help
```
graboskycMBP:~ graboskyc$ MongoRandomizer -h
usage: MongoRandomizer [-h] [-c CS] [-t T] [-b B] [-m M] [-p P] [-w WC] [-j]
[-g]
task
CLI Tool for continually writing random data to a MongoDB database for testing
purposes
positional arguments:
task clean, insert, insertAndUpdate, read, everything
optional arguments:
-h, --help show this help message and exit
-c CS server connection string
-t T threads to use, if left off, use 10
-b B blocksize to use. if not inclided, use 1000
-m M max blocks to use. if not inclided, use 1000
-p P additional chars of padding to increase document size
-w WC write concern to use. if blank, none used
-j, --journaling if omitted, false. if flag enabled, journal
-g, --geo if omitted, use customer data. if flag enabled push
geographic data
```
### Random Inserts
```
graboskycMBP:~ graboskyc$ MongoRandomizer -c mongodb://localhost -t 5 -b 500 -p 10 -w 1 -j insert
About to enter data in:
Threads: 5
DB: demodb
Collection: democollection
Blocksize: 1000
Max Blocks: 500
Write Concern: 1
Journaling: True
This process will continue until you press control+c or break
```
### Sample Document
```
{
"_id" : ObjectId("5b7db58ecc39345cebc78f67"),
"prescriptions" : [
"Drug water adult.",
"Enjoy month.",
"Just always wind summer.",
"Bad street me.",
"Assume.",
"Section.",
"Forward nearly.",
"Town community boy.",
"Vote major.",
"Walk.",
"Left night receive.",
"Relationship speak.",
"Affect nearly.",
"Present star special.",
"Employee instead.",
"Kid foot direction poor.",
"Determine law."
],
"accountNumber" : 48,
"padding" : "aaaaaaaaaa",
"address" : "847 Ferguson Rd.",
"payment" : 60,
"occupation" : "Aid worker",
"singupDate" : ISODate("2018-08-22T19:11:55.442Z"),
"copay" : 20,
"notes" : "Crime evening nation artist blue far fast generation. Play list range none before night everyone. Doctor make score around.",
"zipcode" : "43418",
"state" : "WY",
"fullname" : "Donna Webster",
"deductible" : 300
}
```
### Sample Geo Document
```
{
"_id" : ObjectId("5b9fd129cc39341758236d80"),
"padding" : "",
"notes" : "Wait mean performance view billion plan civil this. Cup prevent season.\nEffect thought while get market war wife oil.",
"name" : "Mr. Antonio Salas MD",
"location" : {
"type" : "Point",
"coordinates" : [
-73.59354663520122,
42.00216814289992
]
}
}
```
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
MongoRandomizer-0.3.9.tar.gz
(4.7 kB
view details)
Built Distribution
File details
Details for the file MongoRandomizer-0.3.9.tar.gz
.
File metadata
- Download URL: MongoRandomizer-0.3.9.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/2.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0e57b769bcd67642470dc1555ccfb4359f21560e745e6ac8634f375ed054dac |
|
MD5 | bd685e53dbc8f8e661cf698d6fa2fb16 |
|
BLAKE2b-256 | 9c83081deadfab2ec9d622c903697ee7731a5b581a7ee897ee253ea6a394614b |
File details
Details for the file MongoRandomizer-0.3.9-py2-none-any.whl
.
File metadata
- Download URL: MongoRandomizer-0.3.9-py2-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab851809c9a470f7e2f738ad6a182bf5cc53d6e4fa19e9595deb3b7bd2249a92 |
|
MD5 | 491561027226f63a43eaf6c157c5dcb3 |
|
BLAKE2b-256 | 4026291f23f570b612072250da9178b27c00a38e509cec6687ac94346fc17541 |