Repository navigation
v0.4.0
First tagged release of prime-pydantic-config — a Pydantic-driven CLI with TOML / YAML / JSON config-file support, published to PyPI as prime-pydantic-config.
Highlights
- Define your CLI from a Pydantic model —
cli(Config)turns aBaseConfiginto a typed argument parser. - Config files — load values from TOML, YAML, or JSON via the
@path/to/config.tomlsyntax (including passing a config file as the root entry), with CLI overrides layered on top. - Custom parser + Rich help renderer — dropped the
tyrodependency in favor of a purpose-built argv parser and Rich-rendered--help(panels, inline defaults, docstrings).
CLI features
- Nested config groups and sub-configs
Optional[BaseModel]sub-fields: bare-flag enable/disable, sub-field overrides, and rendering in--help- Discriminated unions: switch variants via CLI args; multi-variant rendering in
--help - Boolean flags with
--no-negation - List values and
dictfields with unified JSON value parsing and type coercion - Single-dash short flags for single-character aliases
- Validation-alias support
- Docstring inheritance via MRO and
default_factoryrendering in help
Error handling
- Rich-formatted validation errors
- Unknown-flag suggestions
- Clear "config file not found" errors
Packaging & security
- Published to PyPI as
prime-pydantic-config(hatchling build) - PyPI publishing via Trusted Publishers (OIDC) — no long-lived tokens
- 7-day
exclude-newersupply-chain cooldown on dependency resolution