Skip to content

v0.4.0

Choose a tag to compare

@mikasenghaas mikasenghaas released this 20 Jul 19:40
· 5 commits to main since this release
4eeab0c

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 a BaseConfig into a typed argument parser.
  • Config files — load values from TOML, YAML, or JSON via the @path/to/config.toml syntax (including passing a config file as the root entry), with CLI overrides layered on top.
  • Custom parser + Rich help renderer — dropped the tyro dependency 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 dict fields 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_factory rendering 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-newer supply-chain cooldown on dependency resolution