Comparison
argparse vs docopt vs typer vs tyro
Maintenance, adoption and momentum side by side, from PyPI, GitHub and deps.dev data refreshed every day.
Python command-line parsing library
Archived. The repository is read-only: no more fixes or releases will come. It brings a standard-library module to older Pythons: on current versions, use the built-in one.
pip install argparsePythonic argument parser, that will make you smile
Likely abandoned. No release or commit for years (last release over 12 years ago).
pip install docoptTyper, build great CLIs. Easy to code. Based on Python type hints.
Actively maintained. Last release 5 days ago, commits in 20 of the last 26 weeks. A safe choice.
pip install typerCLI interfaces & config objects, from types
Actively maintained. Last release 4 weeks ago, commits in 7 of the last 26 weeks. A safe choice.
pip install tyroIn short
- argparse is archived: avoid it for new projects.
- docopt looks abandoned: avoid it for new projects.
- typer is the most used: 314.1M downloads a month, 12× more than docopt.
- typer also has the best Pythie’s Index (88).
- tyro is growing fastest: downloads +53% over the last month.
- Safe default for a new project: typer.