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
Release files for mincfg 0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mincfg-0.9.tar.gz | 45.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mincfg-0.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 79.0 kB
Release files / mincfg-0.9.tar.gz
| Download URL | mincfg-0.9.tar.gz |
|---|---|
| Size | 45.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d748bc3c519475a241d00d72daaa244567b952ceaa94a8bb067aab3acc75a4fa
|
|
BLAKE2b-256 checksum How to use checksums |
85a8450fd6eca665fd0e24eae63a949abbc61712be65f9f37176427695b92048
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Release files / mincfg-0.9-py3-none-any.whl
| Download URL | mincfg-0.9-py3-none-any.whl |
|---|---|
| Size | 33.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bc6ab6fd65f9ff2a1438640d7b12af7ae31d0b098873aca1c426de29389d2005
|
|
BLAKE2b-256 checksum How to use checksums |
c286ba36bda7f710cf1b596a25cc58cfa90c093e1745dc22e7d987638fa45433
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|