Digesting function arguments into clear, reliable contracts.
ArgDigest is a Python library for digesting function arguments at API boundaries. It helps libraries normalize, validate, and standardize inputs with explicit, reusable contracts.
It combines:
- Argument-centric digestion (per-argument digesters),
- Pipeline rules (reusable validation/coercion by kind and rule name),
- Structured diagnostics (clear warnings and errors with context).
pip install argdigestOptional integrations:
pip install argdigest[beartype]
pip install argdigest[pydantic]
pip install argdigest[pyunitwizard]
pip install argdigest[all]from argdigest import arg_digest
@arg_digest(
config="mylib._argdigest",
strictness="warn",
map={"syntax": {"kind": "std", "rules": ["is_str"]}},
)
def get(molecular_system, selection=None, syntax="MolSysMT"):
return molecular_system, selection, syntaxTypical style options:
package: one module per argument (digest_<argument>),registry: central mapping (ARGUMENT_DIGESTERS),decorator: registration via@argument_digest("arg"),auto: mixed mode for incremental migrations.
ArgDigest emits catalog-based diagnostics through SMonitor.
Runtime/config files:
argdigest/_smonitor.pyargdigest/_private/smonitor/catalog.pyargdigest/_private/smonitor/meta.py
- User + developer docs: uibcdf.org/argdigest
- Compatibility matrix:
docs/content/developer/compatibility-matrix.md - Internal roadmap and implementation notes:
devguide/
- Current stabilization tag:
0.9.2(final pre-1.0 checkpoint). 1.0.0tagging is intentionally gated by explicit release-owner confirmation.- Go/no-go evidence pack:
devguide/1.0.0_go_no_go_pack.md.
MIT. See LICENSE.