Metadata-Version: 2.4
Name: typer-pydantic-config
Version: 0.3.2
Summary: Use [pydantic](https://docs.pydantic.dev/latest/) to manage persistent config for your [Typer](https://typer.tiangolo.com/) CLI apps!
Project-URL: Homepage, https://github.com/david-fischer/typer-pydantic-config
Project-URL: Repository, https://github.com/david-fischer/typer-pydantic-config.git
Project-URL: Issues, https://github.com/david-fischer/typer-pydantic-config/issues
Project-URL: Changelog, https://github.com/david-fischer/typer-pydantic-config/blob/master/CHANGELOG.md
Author-email: David Fischer <d.fischer.git@posteo.de>
License-Expression: MIT
License-File: LICENSE
Keywords: CLI,config,pydantic,python,typer
Requires-Python: >=3.12
Requires-Dist: platformdirs>=4.3.7
Requires-Dist: pydantic>=2.10.6
Requires-Dist: toml>=0.10.2
Requires-Dist: typer>=0.15.1
Description-Content-Type: text/markdown

# Typer Pydantic Config

This package helps you quickly build python CLI applications with a persistent config.

1. Implement config object as [pydantic](https://docs.pydantic.dev/latest/) class
2. Use `get_config` where every you need the current values
3. Build a normal app with [typer](https://typer.tiangolo.com/)
4. start the app with `start_config_app`

On the first invocation, prompts the user to set all values in the config file.

Your app now has an additional `config` command with the following signature:
```text
Usage: example.py config [OPTIONS] COMMAND [ARGS]...

  Interact with config: ( set | init | show | path | delete).

Options:
  --help  Show this message and exit.

Commands:
  delete  Delete config file on disk.
  init    Interactively prompt for every field in the config.
  path    Print config path.
  set     Set one or more config fields via flags.
  show    Print content of config file.
```


## ⚠ Current shortcomings ⚠
 * Supports only the following basic types:
   * Pydantic model
   * int
   * float
   * bool
   * str
   * datetime
   * Path 
 * usage of typer/clicks context in `get_config` could pose problems when package user modifies context
 * setting of `app = typer.Typer(name="<some_unique_name>")` is required
 * if there is already another application with the name installed on the system, this could lead to problems