Skip to main content

CfgStack is a configfile system reader. System? Yeah. In reading and parsing one file, CfgStack can be directed to go read other files and to incorporate their contents into the growing dataset.

CfgStack ("somefile")

Attempts to load the named file as JSON/YAML/TOML with default extensions of json/yaml/yml/toml (can be over-ridden). The loaded object must be a dictionary. The “data” member of the resulting object is an addict Dict of the loaded dataset. So far so simple.

_include_:
  - file1
  - file2
_default_:
  zero: 0
  one: 1
foo:
  this: that
  zero: null
var: value
bar:
  _default_:
    inner: inside_bar
  inside:
    oh: boy
    yep: really
baz:
  _include_:
    - file3

A few things going on here:

  • “_include_” keys are assumed to list additional data files which will be loaded and their contents merged with the dictionary at the same level. If multiple files are listed, they will be applied in order from the top down. Files are searched for in the CWD or optionally in a list of passed paths.

  • “_default_” keys provide default key:value pairs for all dictionary values at the current level

Note that all includes are applied first, then all defaults. Higher level values override lower level values, across both includes and defaults (includes first) and both for contents and data-type.

Release files for cfgstack 0.2.post5

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

Source distribution (sdist)

Source distribution for cfgstack 0.2.post5
File Size Uploaded
cfgstack-0.2.post5.tar.gz 5.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cfgstack 0.2.post5
File Interpreter ABI Platform
cfgstack-0.2.post5-py3-none-any.whl Python 3 none any Details

Total release size: 12.6 kB

Release files / cfgstack-0.2.post5.tar.gz

Download URL cfgstack-0.2.post5.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ba264e868cc9588dbc3ffb7c6e66e0ec9aa3536035c93f81135879039553465f
BLAKE2b-256 checksum
How to use checksums
4d54387ae220a8e2746a96142a17ccfd5182bbb21415cc518c2b2495eb4d98cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.13.2 Linux/6.12.21-amd64

Release files / cfgstack-0.2.post5-py3-none-any.whl

Download URL cfgstack-0.2.post5-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b3753580f220647ff948ba467579451727bac064713cca2800cac54b757b322
BLAKE2b-256 checksum
How to use checksums
1e6b68cf6765442c3211d52149ba67efaff6a5d32cc2fda21d210b3783fd277a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.13.2 Linux/6.12.21-amd64
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