Skip to main content

StrataConf

A layered configuration library for Python. StrataConf merges configuration from three layers: defaults, configs and overrides. Each layer can have multiple sources with all sources and layers being maintained independently.

Features include:

  • Includes via includes: from files or published packages
  • Interpolation via ${...} using configuration paths or resolvers
  • Object instantiation via _target_ with typed coercion
  • Configuration of argparse from YAML files to enable command-line overrides
  • Extracting field defaults from dataclass/Pydantic classes
  • Overriding function parameter defaults via the config_defaults decorator
  • Tracking actively-used configuration values
  • Creating a unique fingerprint of a subset of configuration values

It is built on OmegaConf, with some changes to streamline usage (e.g., resolvers are not namespaced).

Documentation

Full documentation, including a user guide and API reference, is available at fastfedora.github.io/strataconf.

Install

pip install strataconf

Quick Start

from strataconf import Config

config = Config()
config.load_defaults("configs/defaults.yaml")     # base layer
config.load_config("configs/config.yaml")         # main layer, on top of defaults
config.add_overrides({"server": {"port": 9000}})  # highest-precedence layer

port = config.get("server.port")                  # merged + interpolated value

See the documentation for the full guide and API reference.

Development

uv sync
just test      # run the test suite
just lint      # ruff + pyright
just docs      # preview the docs (Quarto)

License

MIT — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

strataconf-1.0.0.tar.gz (155.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

strataconf-1.0.0-py3-none-any.whl (44.0 kB view details)

Uploaded Python 3

File details

Details for the file strataconf-1.0.0.tar.gz.

File metadata

  • Download URL: strataconf-1.0.0.tar.gz
  • Upload date:
  • Size: 155.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for strataconf-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a37ac509c831e8f653a8f51fd1060216350c9e742545808558a2f4804cdbb32d
MD5 cba1a6155898396ed09d9d5f432c8e2c
BLAKE2b-256 aa275076e3a00d82f2251e4908a7451246d50bee32e72a98dbde7bc9cb087860

See more details on using hashes here.

Provenance

The following attestation bundles were made for strataconf-1.0.0.tar.gz:

Publisher: publish.yml on fastfedora/strataconf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file strataconf-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: strataconf-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 44.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for strataconf-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 916f515046a1f2920661ec1e18bb9a774c1e77c43fcaf6a6d2dec12b3c28a44e
MD5 b3d565229ea0bc186d3ee802123e34d4
BLAKE2b-256 5bf552c762053f8ed06dc635de0e01ac20a489db4cf634f6075f30b491acdf2d

See more details on using hashes here.

Provenance

The following attestation bundles were made for strataconf-1.0.0-py3-none-any.whl:

Publisher: publish.yml on fastfedora/strataconf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 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