Argumentation
Argumentation is a Python library that bridges Pydantic models with argparse to create robust, type-safe command-line interfaces with minimal boilerplate. Define your application's configuration using Pydantic models, and Argumentation handles the command-line parsing, validation, and configuration file loading automatically.
Features
- Type-safe Configuration: Utilize Pydantic's validation system for command-line arguments
- Configuration Files: Support for TOML, YAML, and JSON configuration files
- Automatic CLI Generation: Convert your Pydantic models into command-line interfaces automatically
- Rich Type Support: Handles complex types including:
- Basic types (bool, int, float, str)
- Lists and tuples
- Literal types with choices
- Union types
- Custom Pydantic models
Installation
- uv (recommended)
uv add argumentation
- poetry
poetry add argumentation
- pip
pip install argumentation
Usage
- Create your configuration model using the ArgumentationModel
- Create your main function which takes the configuration as an argument
- Call the argumentation.run function with your main function
See examples/simple.py for more details
python examples/simple.py --name "My Application" --debug --port 5000 --hosts localhost 127.0.0.1
Configuration Files
Argumentation supports loading configuration from TOML, YAML, and JSON files.
python examples/config.py --config examples/config.yaml
You can also override configuration file values from the command line.
python examples/simple.py --config examples/config.yaml --port 8888
License
Argumentation is licensed under the MIT License. See the LICENSE file for details.
Metadata
Release files for argumentation 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| argumentation-0.1.0.tar.gz | 23.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| argumentation-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.6 kB
Release files / argumentation-0.1.0.tar.gz
| Download URL | argumentation-0.1.0.tar.gz |
|---|---|
| Size | 23.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a2523fdafe90cead2c6d9b142142680c2afa20db7dcc92edc9e8c6643c954364
|
|
BLAKE2b-256 checksum How to use checksums |
b9b884f59b0a6cfbb6b640225c9ad5597f334ac96181edc28c453d8335354662
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.2
|
Release files / argumentation-0.1.0-py3-none-any.whl
| Download URL | argumentation-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0b5a6b9c24c3d90187831c79486ca95331ffc99018af7b7f5e8dc6725236b1b1
|
|
BLAKE2b-256 checksum How to use checksums |
5f6fff47d25ac84ef621de7ae4cae15aeb1d0e8de240af0d97d4e56ef1c1c3c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.2
|