Configuration library for the molcrafts ecosystem
Project description
molcfg
Configuration library for Python — layered sources, profiles, validation, and source tracking.
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, JSON/TOML/YAML files, environment variables, and CLI arguments
DEEP_MERGE,OVERRIDE, andAPPENDstrategies — all return isolated copies- Recursive schema validation with defaults, strict mode, and built-in constraints
Registry+Buildto resolve config strings like"silu"into classes or instances- 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
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
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 molcrafts_molcfg-1.4.0.tar.gz.
File metadata
- Download URL: molcrafts_molcfg-1.4.0.tar.gz
- Upload date:
- Size: 34.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa5583c7d322a19146fb6e6b3f4b6e08b66cc450788fbe9c3e8170d896e6277e
|
|
| MD5 |
f8cea8a6808a5af8e29e4e6831052df1
|
|
| BLAKE2b-256 |
f175c52d7d2c374a477df60337550bca52baf15ff47ac9ac6114f91b55597ebc
|
Provenance
The following attestation bundles were made for molcrafts_molcfg-1.4.0.tar.gz:
Publisher:
release.yml on MolCrafts/molcfg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
molcrafts_molcfg-1.4.0.tar.gz -
Subject digest:
fa5583c7d322a19146fb6e6b3f4b6e08b66cc450788fbe9c3e8170d896e6277e - Sigstore transparency entry: 1383261123
- Sigstore integration time:
-
Permalink:
MolCrafts/molcfg@3ace892e329ffa503da80f2ad2fc62313105891a -
Branch / Tag:
refs/tags/v1.4.0 - Owner: https://github.com/MolCrafts
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3ace892e329ffa503da80f2ad2fc62313105891a -
Trigger Event:
push
-
Statement type:
File details
Details for the file molcrafts_molcfg-1.4.0-py3-none-any.whl.
File metadata
- Download URL: molcrafts_molcfg-1.4.0-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4ab8ccc692348472cf7f209cb0cfe61c0adfa7ce6b7c080f897b77413ca23e7
|
|
| MD5 |
a976ce2e26d82767f48c75142e449aba
|
|
| BLAKE2b-256 |
d6e2c6f935e5d35759581a7999d457f876998282a9506c337b9d7f607891ee80
|
Provenance
The following attestation bundles were made for molcrafts_molcfg-1.4.0-py3-none-any.whl:
Publisher:
release.yml on MolCrafts/molcfg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
molcrafts_molcfg-1.4.0-py3-none-any.whl -
Subject digest:
d4ab8ccc692348472cf7f209cb0cfe61c0adfa7ce6b7c080f897b77413ca23e7 - Sigstore transparency entry: 1383261156
- Sigstore integration time:
-
Permalink:
MolCrafts/molcfg@3ace892e329ffa503da80f2ad2fc62313105891a -
Branch / Tag:
refs/tags/v1.4.0 - Owner: https://github.com/MolCrafts
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3ace892e329ffa503da80f2ad2fc62313105891a -
Trigger Event:
push
-
Statement type: