Laco

Lazy Configuration for Python

Lazy Configuration for Python

Laco is a Python-first configuration system. It is for engineers who want Hydra's config composition, CLI overrides, and multirun sweeps, but with real imports and IDE support instead of magic strings. Config files are ordinary .py files. Hydra-compatible YAML is the wire format. Type safety comes from lie-typing, a deliberate mismatch between the static and runtime type that makes nested composition safe under both pyright and mypy.

pip install laco

Static types vs. runtime values

Six constructs in Laco declare a static type for the IDE while producing a DictConfig at runtime.

ConstructStatic typeRuntime typeUse case
L.call(T)(...)TDictConfigLazy class construction
L.partial(T)(...)TDictConfigDeferred partial application
L.just(v)type(v)DictConfigWrap an existing value
L.required[T]()TDictConfigMandatory placeholder
L.slot(G)GDictConfigGroup placeholder in schema
L.chosen(G)GDictConfigIn-body reference to chosen entry

laco.instantiate(node) closes the gap. It returns the genuine T, both statically and at runtime.


Start here

New to Laco? Follow the docs in order:

  1. Getting Started: install and run a five-minute example.
  2. Tutorials: an 11-notebook series that builds from first steps to production patterns. The fastest way to learn by doing.
  3. Concepts: the why and how behind the design, for when you want to understand a mechanism rather than just use it.
  4. How-To: task-oriented recipes for specific problems.
  5. Examples & API Reference: annotated source walkthroughs and the full symbol reference for day-to-day work.

All sections

SectionContents
Getting StartedInstall, five-minute example
Tutorials11 Jupyter notebooks, beginner → production
ConceptsWhy and how Laco works
How-ToTask-oriented recipes
ExamplesAnnotated source walkthroughs
IntegrationsOptional extension packages
vs Hydra-zenSide-by-side comparison
Migration 0.x → 1.0Upgrade guide
API ReferenceEvery public symbol