Minimal Application Configuration
Project description
MinCfg
the Minimum Configuration Handling System
There are many configuration management/definition systems. This one is mine. This is an overview. There are also more formal docs.
A set of simple tools to build a configuration system with
The first set are 'sources':
- DictSource, which takes values from a python dict and is useful for defaults
- SubsetSource, which returns a subset of another source, to help with merge precedence
- OSEnvironSource, which parses config values from os.environ into hierarchical dictionaries
- YamlFileSource, which parses a yaml file into hierarchical dictionaires (
pip install mincfg[yaml]
for support) - INIFileSource, which understands INI files (based on configobj) (
pip install mincfg[ini]
for support) - DotEnvSouce, which understands .env files (based on python-dotenv) (
pip install mincfg[env]
for support)
The second tool is:
- MergedConfiguration: which merges multiple configuration sources into a coherent whole
Yes, much more could be done:
- required keys
- value validation
- default parsers
- default default values (that .get() without a default would default to)
- more file types (json, ... xml?)
- sphinx/rtd docs
... PRs accepted!
Much inspiration - and the .get() signature - is taken from everett, but the implementation is all mine.
To install
pip install mincfg
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
mincfg-0.9.tar.gz
(45.2 kB
view details)
Built Distribution
mincfg-0.9-py3-none-any.whl
(33.8 kB
view details)
File details
Details for the file mincfg-0.9.tar.gz
.
File metadata
- Download URL: mincfg-0.9.tar.gz
- Upload date:
- Size: 45.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d748bc3c519475a241d00d72daaa244567b952ceaa94a8bb067aab3acc75a4fa |
|
MD5 | a6f0b0da106b00ba0c111339eca5b4ca |
|
BLAKE2b-256 | 85a8450fd6eca665fd0e24eae63a949abbc61712be65f9f37176427695b92048 |
File details
Details for the file mincfg-0.9-py3-none-any.whl
.
File metadata
- Download URL: mincfg-0.9-py3-none-any.whl
- Upload date:
- Size: 33.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc6ab6fd65f9ff2a1438640d7b12af7ae31d0b098873aca1c426de29389d2005 |
|
MD5 | ade907a85eb2e719953608b95e367b5a |
|
BLAKE2b-256 | c286ba36bda7f710cf1b596a25cc58cfa90c093e1745dc22e7d987638fa45433 |