Skip to main content

Python-first config loader with composition and CLI overrides.

Project description

cfgx

PyPI version

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

cfgx-0.1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

cfgx-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

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

Hashes for cfgx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 16a4b50d80525eb75e804467b3afea4341752583254633b3db6655f9f0aa116b
MD5 d210a28123546d24d224b60d10228cf8
BLAKE2b-256 6b122747aeca379260d64f51a20262972a8bb414e3c07775b1835f332b9a477d

See more details on using hashes here.

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

Hashes for cfgx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6d15a018a70043058a5466d47acbece4eb360ceb4ff8a01ada80fdb7b3cd5b17
MD5 9ad4022642e2ca88c9ccfcae4efba013
BLAKE2b-256 aa7ad06dfb73403391c046b0ff294db38b56a0ad0ad924e023586e5e4e6c8f3f

See more details on using hashes here.

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