Configuration management
% start main % start synopsis
This module provides infrastructure for loading, merging, and managing configuration data from multiple sources. It includes:
- Multi-source configuration loading (files, environment, programmatic)
- Hierarchical configuration with automatic merging
- Context-aware configuration access
- Configuration inheritance with
$basereferences - Lazy loading of module-specific configurations
% end synopsis
% end main
Usage
from moat.lib.config import CFG
# Initial setup (once, at program startup)
CFG(name="myapp")
# loads `/etc/myapp.yaml` (and others)
# Access configuration data
print(CFG.database.host)
Configuration Sources
The CfgStore class combines configuration from multiple sources (in order of precedence):
- Command-line arguments (via
modmethod) - Preloaded configuration (passed to constructor)
- Environment variables (in
CfgStore.env) - Explicitly added config files (via
addmethod) - Default config files (from standard paths)
- Static module configurations (loaded via
with_)
Metadata
Release files for moat-lib-config 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| moat_lib_config-0.2.3.tar.gz | 14.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| moat_lib_config-0.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.1 kB
Release files / moat_lib_config-0.2.3.tar.gz
| Download URL | moat_lib_config-0.2.3.tar.gz |
|---|---|
| Size | 14.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c996936560bc09c70c2978864be9f1c747743f925db1421be1ad464e5b27bdbf
|
|
BLAKE2b-256 checksum How to use checksums |
889569654c2190f03f3db2b7ee329a0b0128789009d9dae0054ebeca9856a43a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / moat_lib_config-0.2.3-py3-none-any.whl
| Download URL | moat_lib_config-0.2.3-py3-none-any.whl |
|---|---|
| Size | 13.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d3b0bd0058923ae1ff001254f83d6cfdef5dffcd4acf699c78b1a9ff086d2ca0
|
|
BLAKE2b-256 checksum How to use checksums |
5c8305572c565f7636828e0fa27e8c199d1af2b16d1e9c35f55c14da0ee4cf98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|