Skip to main content

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

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

MIT 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

MongodbDatabaseEngine-0.0.9.tar.gz (4.6 kB view details)

Uploaded Source

File details

Details for the file MongodbDatabaseEngine-0.0.9.tar.gz.

File metadata

  • Download URL: MongodbDatabaseEngine-0.0.9.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.3

File hashes

Hashes for MongodbDatabaseEngine-0.0.9.tar.gz
Algorithm Hash digest
SHA256 1eddbdc9f94d4e238c11189087bdf60f9bc6b3f1200a339f7ba86115335975bd
MD5 7c61e2e48d0e9d396e1264dc771f0612
BLAKE2b-256 bd6e78c5d70fabe0cd5463b1bbe1f0d192b9161ca7d4f5aa4f198126020f5555

See more details on using hashes here.

Supported by

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