Configuration management for MoaT applications
Project description
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_)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file moat_lib_config-0.1.2.tar.gz.
File metadata
- Download URL: moat_lib_config-0.1.2.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08b6ae296e01677bf51bd424623451227c9765a42ac5f2e2a7e58479bdae882d
|
|
| MD5 |
b416e55a48f00cdcd16c0f09c6db45ca
|
|
| BLAKE2b-256 |
d5e1cc2d557d6534c38897ad194e76ee43da2819e6ee1667b94e543829538b69
|
File details
Details for the file moat_lib_config-0.1.2-py3-none-any.whl.
File metadata
- Download URL: moat_lib_config-0.1.2-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4dfb247c91c099e7d6ac95424f5f8018b92f8e060ab9c29dfcd402850142f7a
|
|
| MD5 |
b75d8a052badba685d12fcbc598eceb7
|
|
| BLAKE2b-256 |
81adda632e6db5b150559f0feac1987f23f7d6c4aa7726353f416168c4bcc3e8
|