Use [pydantic](https://docs.pydantic.dev/latest/) to manage persistent config for your [Typer](https://typer.tiangolo.com/) CLI apps!
Project description
Typer Pydantic Config
This package helps you quickly build python CLI applications with a persistent config.
- Implement config object as pydantic class
- Use
get_configwhere every you need the current values - Build a normal app with typer
- 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:
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file typer_pydantic_config-0.3.1.tar.gz.
File metadata
- Download URL: typer_pydantic_config-0.3.1.tar.gz
- Upload date:
- Size: 21.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69bf1e5dd66c870a6fae92f0468c7286f99ffffd12347a17e627416945971775
|
|
| MD5 |
03f77eeb13fb8da95b90eb49d538e236
|
|
| BLAKE2b-256 |
b3fbaa30607f82f315c60f5f17801e3ec29386c4479230600de68ef8f609a8da
|
File details
Details for the file typer_pydantic_config-0.3.1-py3-none-any.whl.
File metadata
- Download URL: typer_pydantic_config-0.3.1-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90d4a19e43ab47925b3fd2c36a5caa1c9f95041fb7e93412c7ea9dc93887279a
|
|
| MD5 |
5d5b06151cd869c3e80deaa02f7b7880
|
|
| BLAKE2b-256 |
5cf98047be0af6f31f3e2774bfd29a5569d3324e9a65062e7201ae29336b609f
|