An implicit configuration system for Python. Tracks constructor arguments, supports lazy instantiation, and serializes/deserializes configurations to JSON ("fingys").
src/confingy/— library source (src layout)tracking.py— core@track,lazy,lens,Lazy[T],disable_validationfingy.py—serialize_fingy,deserialize_fingy,save_fingy,load_fingy,transpile_fingy,prettify_fingyserde.py— serialization/deserialization internals (handlers, registry, keys)exceptions.py—ValidationError,SerializationError,DeserializationErrormypy_plugin.py— mypy plugin for tracked classescli/— typer CLI (confingy serialize,confingy transpile,confingy viz)viz/— graph visualization (optional[viz]extra: fastapi + uvicorn)utils/— hashing, imports, type checks
tests/— pytest test suiteexamples/— usage examples (dataloading, lens, training loop, transpile, pydantic validation)docs/— mkdocs documentation
uv sync --group dev --extra vizAlways use uv run or make targets to run commands. Never activate the venv manually or use pip.
| Command | What it does |
|---|---|
make pytest |
Run tests (uv run --group dev --extra viz pytest -vv) |
make mypy |
Type check (uv run --group dev --extra viz mypy -p confingy) |
make lint |
Lint (uv run --group dev --extra viz ruff check) |
make format-check |
Check formatting (uv run --group dev --extra viz ruff format --check) |
make docs |
Build mkdocs site |
make serve-docs |
Serve docs locally |
To run a one-off Python script: uv run python myscript.py
- Tests are in
tests/and run withmake pytest - CI runs against Python 3.10, 3.11, 3.12, 3.13
- The local
.python-versionis 3.10.12
- Ruff linting and formatting is enforced automatically via a Claude Code hook (
.claude/settings.json) — it runsruff check --fixandruff formatafter every Python file edit. - Never use
py_compile - Per-file ignores:
ANN001is suppressed inexamples/andtests/
- Uses mypy with the
confingy.mypy_pluginplugin (configured inpyproject.toml) - Run with
make mypy
- Google style docstrings
- Avoid
typing.Anyunless absolutely necessary - Minimize dependencies — the core has only pydantic, typer, and typing_extensions
- Prefer composition and dependency injection over inheritance
uvis the package manager — never use pip directly
GitHub Actions workflows on push/PR to main:
pytest.yml— tests across Python 3.10–3.13mypy.yml— type checkingruff.yml— lint + format checkdocs.yml— docs buildpublish.yml— PyPI publishing on release