This is a small utility library that can be used to easily create a MongoDB connection based on the data in a simple YAML configuration file.
Run the following pip command to install this package:
pip install https://github.com/cisagov/mongo-db-from-config/tarball/developTo use this package, first create a YAML configuration file that contains the information needed to connect to your Mongo database. Here is a sample configuration file:
database:
uri: mongodb://username:password@localhost:27017/auth-db-name
name: db-nameHere is an example of how to use this package in your Python code:
from mongo_db_from_config import db_from_config
db = db_from_config("my_db_config.yml")We welcome contributions! Please see CONTRIBUTING.md for
details.
This project is in the worldwide public domain.
This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.
All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.