docopt-ng
Jazzband-maintained fork of docopt, the humane command line arguments parser.
Decision gist · record as of 2026-08-14
Yes. docopt-ng is a lightweight, actively maintained parser with zero runtime dependencies, permissive licensing, and no known vulnerabilities. Install it if you prefer defining CLI arguments via docstring conventions and want a minimal dependency footprint. Skip it if you need advanced features like type coercion, nested subcommands, or rich help formatting—argparse or Click are better fits for those cases.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.7 or later.
- Low friction—a pure Python wheel with no runtime dependencies.
- Actively maintained by jazzband since its fork, with recent commits and complete test coverage.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in commercial and private projects with minimal attribution requirements.
last release 2023-05-30 (1172 days) · last repo commit 2026-07-19 · 223 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,822,308 downloads/mo, #3,517 on PyPI
Alternatives
Verify before relying
from docopt import docopt
doc = """Usage: prog.py [--verbose] FILE
Options:
--verbose Enable verbose output.
"""
args = docopt(doc, ['--verbose', 'input.txt'])
print(args)- Performance characteristics with large or complex usage patterns.
- Compatibility with non-ASCII characters in argument names or help text.
- Behavior when docstring format deviates from documented conventions.
What it is and what it does
docopt-ng is a command-line argument parser that derives its parsing rules directly from a help message written in your code's docstring. Instead of defining arguments separately via decorators or configuration objects, you write a usage pattern and option descriptions in plain text, and docopt-ng parses them to validate and extract command-line arguments. It returns a simple dictionary mapping option names, arguments, and commands to their parsed values.
The package is a maintained fork of the original docopt, now under jazzband stewardship with type hints and full test coverage. It supports Python 3.7 and later, has no runtime dependencies, and works with both CPython and PyPy. The approach trades some flexibility for simplicity: if your help message is well-formed, the parser is automatically correct, and your documentation and argument handling stay synchronized.
Use it for
- Build a simple CLI tool where the help message is the source of truth for argument parsing.
- Add argument parsing to a script without introducing a heavy dependency like argparse or Click.
- Generate a command-line interface for a utility where the usage pattern is already documented.
- Parse subcommands and options in a tool that dispatches to other programs or modules.
- Prototype or maintain a CLI where keeping help text and code in sync is a priority.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
docopt-ng is a lightweight, actively maintained parser with zero runtime dependencies, permissive licensing, and no known vulnerabilities. Install it if you prefer defining CLI arguments via docstring conventions and want a minimal dependency footprint. Skip it if you need advanced features like type coercion, nested subcommands, or rich help formatting—argparse or Click are better fits for those cases.
Install
docopt-ng on PyPI
Before you install
Low friction—a pure Python wheel with no runtime dependencies. Actively maintained by jazzband since its fork, with recent commits and complete test coverage.
Requires Python 3.7 or later.
License in practice
MIT license permits unrestricted use, modification, and distribution in commercial and private projects with minimal attribution requirements.
Quickstart
from docopt import docopt
doc = """Usage: prog.py [--verbose] FILE
Options:
--verbose Enable verbose output.
"""
args = docopt(doc, ['--verbose', 'input.txt'])
print(args)
Verify before relying
- Performance characteristics with large or complex usage patterns.
- Compatibility with non-ASCII characters in argument names or help text.
- Behavior when docstring format deviates from documented conventions.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 1,172 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,822,308 / month, #3,517 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy |
Evidence: docopt_ng-0.9.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “docstring-based CLI parser”
- docopt-ngParses command-line arguments and options from a docstring-based…
- docoptParses command-line arguments based on a help message docstring,…
- cycloptsCyclopts is a CLI framework that converts Python functions into…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also docopt · rich-argparse · autocommand · arguably · mando · docstring-parser · pydocstringformatter · argparse-dataclass · entrypoint2 · flake8-docstrings