This python package is to create mongodb database, collections automatically using json file and can be integrated with API
Project description
# # ###
# # # ### # ## # ## ## # ## ## ## ##
# # # # # # # # # # # ## ### ## # # # # # # # ###
# # # # # # # # # # # ## # # # # ## # # # #
## ## # ## ## ## ## ## ### # # # # # # ##
##
Instruction
This package is for creating the mongodb database and ith various collection dynamically. This can be used standalone or with integrated on API
Pre-requisites
- Mongodb installed on pc
- python 3.7.3 with pip or above
Folder architecture
C:.
│ License
│ README.md
│ requirements.txt
│ setup.sh
│ __init__.py
│
├───conf
│ soft.conf
│
└───db
config.json
How to use it?
use case 1
from MongodbDatabaseEngine import engine
engine()
It will create the Mongodb database with name mentioned on soft.conf file and create the collection with the name and data available on config.json.
use case 2
from MongodbDatabaseEngine import engine
engine(databasename="mydatabase")
This will create database with name "mydatabase" and utilize the default data mentioned on config.json
use case 3
import json
userdata=json.load(open(path+r"/db/config.json",'r'))
from MongodbDatabaseEngine import engine
engine(userdata=userdata, databasename="mydatabase")
This use case is for custom database and custom collection data
Information on config.json | userdata
engine methods takes dictionary as input. Key names are used as collection names and value is used as json array data user want to store in respective collection.
Author
Ashish Kumar
License
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
Hashes for MongodbDatabaseEngine-0.0.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8a8e1a44217b132d89efc4bd83e7d40c972a2b7f2c3a8bd4bf69ae5015be279 |
|
MD5 | 8cebe477977015235e1c0f708f1bb6d6 |
|
BLAKE2b-256 | b36a1debf2b281e4ceccb16a36e0e79be4ce60d66327db19e1d5a1ebb4009ecc |