Skip to main content

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 $base references
  • 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 mod method)
  • Preloaded configuration (passed to constructor)
  • Environment variables (in CfgStore.env)
  • Explicitly added config files (via add method)
  • Default config files (from standard paths)
  • Static module configurations (loaded via with_)

Metadata

Release files for moat-lib-config 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for moat-lib-config 0.2.4
File Size Uploaded
moat_lib_config-0.2.4.tar.gz 14.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for moat-lib-config 0.2.4
File Interpreter ABI Platform
moat_lib_config-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 27.1 kB

Release files / moat_lib_config-0.2.4.tar.gz

Download URL moat_lib_config-0.2.4.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1dbfc3f480cef8737dc0f4dd837a167c34cc498263a96e6ff5ba5d6277e41848
BLAKE2b-256 checksum
How to use checksums
47abebe3e01239c0e5ac18579cfd800c4c8cb16fbbd7edbacb3462621281cbc0
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.4-py3-none-any.whl

Download URL moat_lib_config-0.2.4-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4d17cbf0004f736649ba05acb9021be0577beff261dc555275b2f7c8b976a87b
BLAKE2b-256 checksum
How to use checksums
094390fefdd81def31dbd545897e13eee4ae813ed128778b97cbef052def088c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

0.2.4 This release

2 release files

0.2.3

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page