Skip to main content

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

  1. uv (recommended)
uv add argumentation
  1. poetry
poetry add argumentation
  1. pip
pip install argumentation

Usage

  1. Create your configuration model using the ArgumentationModel
  2. Create your main function which takes the configuration as an argument
  3. 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)

Source distribution for argumentation 0.1.0
File Size Uploaded
argumentation-0.1.0.tar.gz 23.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for argumentation 0.1.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page