Mongo Database Connector Python Library
Project description
MongoDBConnector
A singleton MongoDB connector library with support for multiple databases and multiple connection URIs.
Installation
pip install pymongo pytz MongoDatabaseConnector
Usage
from mongo_database_connector import get_database
# Connect using environment defaults or fallback values.
default_db = get_database()
# Connect to a named database on the default URI.
users_db = get_database(db_name='users')
# Connect to a different URI and database.
analytics_db = get_database(uri='mongodb://localhost:27018', db_name='analytics')
Environment Variables
MONGO_DB_URI— default MongoDB URI (fallback:mongodb://localhost:27017)MONGO_DB_NAME— default database name (fallback:test)MONGO_DB_TZ— default timezone (fallback:Asia/Kolkata)MONGO_DB_DEBUG— enable debug loggingMONGO_DB_DEBUG_URI— print default URI and database name during initialization
pip install build twine
python -m build
twine --verbose upload dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mongodatabaseconnector-0.1.1.tar.gz.
File metadata
- Download URL: mongodatabaseconnector-0.1.1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7b019d4af0f8f3fb499f7b909fda34ab84504b52a2609e9a396dae8f91e4186
|
|
| MD5 |
a6bf0740b1c8b3e3db8ab1a2e8c76658
|
|
| BLAKE2b-256 |
5bc1f0a6a9855a56d029caa6c1b3cfc32e5364c61db865a9afa5dd99eb16000e
|
File details
Details for the file mongodatabaseconnector-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mongodatabaseconnector-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32c34560541120cc686c4a75933186a7f7f60b68ff379f6699c78550937c6123
|
|
| MD5 |
d619503e0e37f76b6872f0851946dd9e
|
|
| BLAKE2b-256 |
fdad15ed18410fa0d86607445fe57827bc49e98d30befeeba941d1ef86d95f21
|