Digesting dependencies into clear, actionable insight.
DepDigest is a lightweight Python library for managing optional dependencies and lazy loading in large analytical or scientific projects.
It helps maintain a "Zero-Cost Startup" by ensuring that heavy external libraries are only checked and imported when actually needed.
Understand your dependencies. Trust your code.
- User guide:
docs/content/user/index.md - Developer guide:
docs/content/developers/index.md - Contribution guide:
CONTRIBUTING.md - Implementation contract:
standards/DEPDIGEST_GUIDE.md
@dep_digestDecorator: Enforce dependency availability at runtime with clear error messages.- Lazy Loading: Discover and load modules (plugins, forms) from directories only when accessed.
- Architecture Validation: Tools to scan your codebase and ensure no top-level imports of soft dependencies leak into your core.
- Audit CLI:
depdigest auditcommand for CI-friendly lazy-import checks. - Symmetry with ArgDigest: Designed to work in tandem with argument validation frameworks.
- smonitor integration: Structured diagnostics for missing dependencies.
- Runtime config discovery: Automatically resolves package
_depdigest.py. - Manual config registration: Supports dynamic/testing contexts via
register_package_config.
from depdigest import dep_digest, get_info
@dep_digest('openmm')
def simulate(system):
import openmm
# ...
def dependency_info():
return get_info("my_package")DepDigest emits structured events when a dependency is missing. Configuration is
loaded from _smonitor.py in the package root (depdigest/_smonitor.py), and
the catalog lives in depdigest/_private/smonitor/catalog.py with metadata in
depdigest/_private/smonitor/meta.py.
conda install -c uibcdf depdigest- Python
>=3.11,<3.14 - Runtime dependency:
smonitor
Run tests:
pytest -qRun tests with coverage:
pytest --cov=depdigest --cov-report=term-missingRun architecture audit:
depdigest audit --src-root depdigest --soft-deps openmm,mdtrajBuild docs locally:
make -C docs htmlMIT License.