Installation

Since v0.2.0, cfgdrift is installable and runnable on any Python 3.8+. The C extension is an optional accelerator — when it is not compiled or the build fails, the package automatically falls back to the pure-Python parsers.

pip install cfgdrift            # general install (pip auto-selects the wheel)
pip install "cfgdrift[web]"     # includes the Web dashboard
pip install "cfgdrift[dev]"     # includes test dependencies

Dual-wheel release model

ArtifactTarget usersDescription
cfgdrift-<ver>-py3-none-any.whlall Python 3.8+pure-Python universal wheel (default primary release)
cfgdrift-<ver>-cp313-*-*.whlCPython 3.13optional C-accelerated platform wheel (faster JSON/TOML/INI parsing)
cfgdrift-<ver>.tar.gz (sdist)needs local compilationships C sources; pip install tries to compile and auto-falls back on failure

pip's tag priority naturally delivers the accelerated wheel to CPython 3.13 users and the universal one to everyone else.

Local build recipes

# pure-Python universal wheel (deterministic, no C compilation)
CFGDRIFT_NO_C=1 python -m build --wheel

# C-accelerated platform wheel (optional; requires a C99 compiler)
python -m build --wheel

# sdist (ships C sources; do not set CFGDRIFT_NO_C)
python -m build --sdist

Environment variables

VariableValueDescription
CFGDRIFT_BACKENDauto (default) / pure / cparser backend selection; auto uses C when available and silently falls back to pure Python
CFGDRIFT_DEBUG1enables logging.DEBUG and prints the current parse backend
CFGDRIFT_NO_C1 / true / yesskips C extension compilation at build time
CFGDRIFT_HOMEpathoverrides the data directory (default ~/.cfgdrift/)
GITHUB_TOKENtokenGitHub token for the corpus star check
CFGDRIFT_CV_RETENTION_DAYSintegerretention days for constraint violations (default 90)

Dual-mode consistency

Valid input produces semantically equivalent trees under both the C and pure-Python backends (type-sensitive, key order not considered); invalid input raises ValueError in both backends, with messages starting parse error at line L, column C (text after the colon may differ). The tests/test_dual_mode.py suite runs consistency regression on both backends using the same corpus.

Known documented differences

See the v0.2.0 section (Appendix A) of docs/system_design.md for the design details:

Choose the backend with the CFGDRIFT_BACKEND environment variable (auto / pure / c); CFGDRIFT_DEBUG=1 logs the active backend (parser backend: c/pure).