Home
The Problem¶
If you have ever written a Python project — especially in machine learning — you have probably dealt with configuration: learning rates, file paths, model parameters, dataset options. At first you hard-code them, then you move them to a dictionary, then maybe a YAML file. But soon you run into problems:
-
No validation
Misspell a key (
lerning_rateinstead oflearning_rate) and nothing complains — the value is silently ignored. Pass a string where an integer is expected and you get a crash deep in your training loop. -
No typing
Every value is a raw string or number. If your code expects a
Pathobject, you have to remember to convert it yourself. -
No wiring
You load config values but still have to manually write
MyDataset(num_classes=config["num_classes"])everywhere. -
Too much boilerplate
As configs grow, the glue code between "reading a YAML file" and "having usable objects" keeps expanding.
EzConfy eliminates all of this. Write a YAML config, optionally define a schema, and get back fully instantiated, validated Python objects — ready to use.
Key Features¶
-
YAML config files
Human-readable, easy to diff and version-control.
-
Pydantic validation
Define a schema and get automatic type checking with clear error messages.
-
Schema-aware type casting
Values are cast to schema types before constructors run — strings become
Pathobjects automatically. -
Dynamic object instantiation
Construct any Python class from config using
_target_type_. -
Placeholders & expressions
Reference other values with
${key}, including attribute access, method calls, and arithmetic. -
Multi-file deep merge
Split configs across files, override per experiment — later files win.
-
Code generation CLI
Generate Pydantic model files from your schema for editor autocompletion.
Installation¶
Requirements
Python 3.11 or later.
Quick Example¶
Three files, three lines of Python, and you get validated, typed configuration.
What's Next?¶
-
A step-by-step tutorial from zero to a working config.
-
The full type syntax reference.
-
Construct Python objects directly from YAML.
-
Reference and compute across config values.
-
Split, merge, and override configurations.
-
Generate Pydantic models from your schema.