Quickstart
Requirements
- Python 3.12 or later
Installation
Install from PyPI:
$ pip install wizdantic
Or with uv:
$ uv add wizdantic
Your first wizard
Then run it:
$ python wizard.py
When you run this, the wizard walks through each field in order:
titleis required (no default), so the wizard insists on a value.page_countshows300as the default. Press Enter to accept it or type a new number.ink_weight_kgandcursedwork the same way, with0.4andFalseas defaults.
After the last field, a summary table is printed and you get back a validated
Spellbook instance.
Validation
Every value is validated inline using Pydantic's TypeAdapter. If you type
"twelve" for page_count, the wizard shows an error and re-prompts
immediately. No partial models, no deferred validation.