Skip to main content

Zero-dependency configuration library for the molcrafts ecosystem

Project description

molcfg

CI PyPI Ruff Python License

Zero-dependency configuration library for Python.

Quick Start

from molcfg import CliSource, ConfigLoader, DictSource, EnvSource

cfg = ConfigLoader([
    DictSource({"db": {"host": "localhost", "port": 5432}}, name="defaults"),
    EnvSource(prefix="APP", name="env"),
    CliSource(["--db.port=6432"], name="cli"),
]).load()

assert cfg["db.port"] == 6432
assert cfg.meta("db.port") == {"source": "cli", "history": ("defaults", "cli")}
pip install molcrafts-molcfg

Features

  • Layered loading from dicts, TOML/JSON files, environment variables, and CLI arguments
  • DEEP_MERGE, OVERRIDE, and APPEND strategies — all return isolated copies
  • Recursive schema validation with defaults, strict mode, and built-in constraints
  • Source tracking via Config.meta() for every value
  • Attribute and dotted-path access, freeze, snapshot, and rollback
  • Thread-safe wrapper and POSIX file lock
  • ${path.to.key} and ${env:VAR} interpolation
  • No runtime dependencies

Built with love by MolCrafts

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

molcrafts_molcfg-1.1.0.tar.gz (28.1 kB view details)

Uploaded Source

Built Distribution

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

molcrafts_molcfg-1.1.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file molcrafts_molcfg-1.1.0.tar.gz.

File metadata

  • Download URL: molcrafts_molcfg-1.1.0.tar.gz
  • Upload date:
  • Size: 28.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for molcrafts_molcfg-1.1.0.tar.gz
Algorithm Hash digest
SHA256 ecdfe5c7885fd34b798bd2ae1e2d719256e86d1f249ee60f38f9cadf4e16d369
MD5 d8a7abac083bc089a5d5958c359176f8
BLAKE2b-256 10e71b8e976193f9c039dc8377d807c7d46febed90ece1ac7e66defe444f6ab5

See more details on using hashes here.

Provenance

The following attestation bundles were made for molcrafts_molcfg-1.1.0.tar.gz:

Publisher: release.yml on MolCrafts/molcfg

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

File details

Details for the file molcrafts_molcfg-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for molcrafts_molcfg-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9cf35873a2985ae405e59ff6eb061025e6cb36769cfa0541ef984f011562b9f
MD5 aeae7a641830bedba94ce543fa6aa51b
BLAKE2b-256 075e4a6301b218000cf4015fa1d5547626959c8ab84dc5b4a832404476999f91

See more details on using hashes here.

Provenance

The following attestation bundles were made for molcrafts_molcfg-1.1.0-py3-none-any.whl:

Publisher: release.yml on MolCrafts/molcfg

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page