--- id: typed-argument-parser version: "1.12.0" license: MIT license_treatment: permissive maintenance: active --- # typed-argument-parser — Typed Argument Parser License: permissive · Maintenance: active · Downloads: 313.9K/mo ## What it is and what it does typed-argument-parser replaces Python's built-in argparse with a class-based, type-hinted approach where you define command-line arguments as typed class attributes instead of calling add_argument repeatedly. It automatically generates help text from inline comments, validates types at parse time, and integrates with IDEs for code completion and type checking. The package also includes tapify, a decorator that automatically parses command-line arguments to call functions or initialize classes. Under the hood, typed-argument-parser is a wrapper around argparse that translates your class definition into the equivalent argparse configuration. It supports standard argument types (str, int, float, bool, Optional, List, Set, Tuple, Literal, Union), positional arguments, subparsers, and argument post-processing via a configure method. The single runtime dependency is docstring-parser, which extracts help text from your comments. Use it for: - Build a CLI tool where type hints serve as both documentation and runtime validation without repeating type declarations. - Migrate from argparse to gain IDE autocomplete and static type checking on parsed arguments. - Use tapify to quickly expose a Python function as a command-line tool with automatic argument parsing. - Define reusable argument templates by subclassing and inheriting argument definitions across multiple CLI tools. - Save and load argument configurations to/from files or dictionaries for reproducible runs and experiment tracking. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A typed, modern replacement for Python's argparse that uses class attributes and type hints to define command-line arguments with static type checking and IDE code completion support. Yes. typed-argument-parser is worth installing if you write CLI tools in Python and want type safety, IDE support, and cleaner code than argparse. It has low install friction, active maintenance, no known vulnerabilities, a permissive MIT license, and requires only one runtime dependency. The main constraint is Python 3.10+, which is reasonable for new projects. ## Install pip install typed-argument-parser uv add typed-argument-parser poetry add typed-argument-parser ## Installing typed-argument-parser Before you install: Low friction install with a single runtime dependency (docstring-parser). The package is actively maintained with a recent release (139 days ago) and requires Python 3.10 or later. License in practice: MIT license is permissive, allowing use in commercial and private projects with minimal restrictions—you only need to include the license text in distributions. Quickstart: pip install typed-argument-parser from typed_argument_parser import Tap class MyArgs(Tap): name: str count: int = 1 args = MyArgs().parse_args() print(f'{args.name} x {args.count}') Requires Python 3.10 or later. Verify before relying: - Whether tapify works with all standard Python callables or has edge cases. - Performance characteristics compared to argparse for large argument sets. - Whether subparser and advanced argparse features are fully supported or have limitations. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 313.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags typed command line argument parser, argparse with type hints, python cli argument parsing, static type checking cli, modern argument parser python, dataclass-style argument parser, IDE autocomplete command line, cli-framework, type-hints, argparse-alternative [View on SkillFed](https://skillfed.io/packages/typed-argument-parser) · [View on PyPI](https://pypi.org/project/typed-argument-parser/)