Skip to content

Simple library to instantiate a MongoDB database connection based on the data in a YAML configuration file

License

Notifications You must be signed in to change notification settings

cisagov/mongo-db-from-config

Repository files navigation

mongo-db-from-config ⚙️

GitHub Build Status CodeQL Coverage Status Known Vulnerabilities

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.

Installation

Run the following pip command to install this package:

pip install https://github.com/cisagov/mongo-db-from-config/tarball/develop

Usage

To 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-name

Here 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")

Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

License

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.

About

Simple library to instantiate a MongoDB database connection based on the data in a YAML configuration file

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published