Configuration tool for all Navigator Services Tool for accessing Config info from different sources.
Project description
Navigator NavConfig
NavConfig is a configuration tool for getting variables from environment and other sources. Is used by Navigator Framework, but is possible to use in other applications as well.
Navigator NavConfig can load Configuration directives from different sources:
- Environment files (.env)
- Memcached Variables
- INI files (using configParser)
- Redis Server
The main goal of NavConfig is centralize configuration access in a single and immutable unique point of truth.
NavConfig can be shared across several modules.
Installation
pip install navconfig
Quickstart
First of all, let's create a simple configuration environment.
Creates a directory for an .ini file and the environment file.
mkdir {env,etc}
put a .env file inside of "env" folder, the first line is the directive to know where the "ini" file lives (even we can put the .ini file outside of current dir).
CONFIG_FILE=etc/myconfig.ini
APP_NAME=My App
Then, in your code, call navconfig "config" object, and start getting your environment variables inside your application.
from navconfig import config
APP_NAME = config.get('APP_NAME')
# the result is "My App".
Dependencies
- ConfigParser
- Python-Dotenv
Requirements
- Python >= 3.8
- asyncio (https://pypi.python.org/pypi/asyncio/)
- asyncdb
- python-dotenv
Contribution guidelines
Please have a look at the Contribution Guide
- Writing tests
- Code review
- Other guidelines
Who do I talk to?
- Repo owner or admin
- Other community or team contact
License
Navigator is dual-licensed under BSD and Apache 2.0 licenses.
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
Hashes for navconfig-0.7.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bfef8243999e9a71db5d27b44d8479307d3e6480ad1ff950f426e75ef78d3c1 |
|
MD5 | 3fa09cde4a25b26d56a326f470460d1d |
|
BLAKE2b-256 | a2c352270cd29fca750a72dad41c1b458ed39c46731febed711db4c633e431fc |