Python-first config loader with composition and CLI overrides.
Project description
cfgx
Python-first config loader with parent chaining, parameterized templates, and CLI-style overrides.
Docs: https://kabouzeid.github.io/cfgx/
Install
pip install cfgx
Quick start
Example config file:
# configs/model.py
config = {
"data": {"dataset": "imagenet", "batch_size": 128},
"model": {"depth": 8, "width": 512, "dropout": 0.1},
"optimizer": {"lr": 3e-4, "weight_decay": 0.01},
"trainer": {"max_steps": 50_000, "mixed_precision": "bf16"},
}
from cfgx import apply_overrides, load
cfg = load("configs/model.py")
cfg = apply_overrides(cfg, ["optimizer.lr=1e-3"]) # update nested keys
Works well with specbuild when you want to build your model and other classes from config dictionaries.
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 cfgx-0.1.0.tar.gz.
File metadata
- Download URL: cfgx-0.1.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16a4b50d80525eb75e804467b3afea4341752583254633b3db6655f9f0aa116b
|
|
| MD5 |
d210a28123546d24d224b60d10228cf8
|
|
| BLAKE2b-256 |
6b122747aeca379260d64f51a20262972a8bb414e3c07775b1835f332b9a477d
|
File details
Details for the file cfgx-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cfgx-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d15a018a70043058a5466d47acbece4eb360ceb4ff8a01ada80fdb7b3cd5b17
|
|
| MD5 |
9ad4022642e2ca88c9ccfcae4efba013
|
|
| BLAKE2b-256 |
aa7ad06dfb73403391c046b0ff294db38b56a0ad0ad924e023586e5e4e6c8f3f
|