--- id: docopt-ng version: "0.9.0" license: MIT license_treatment: permissive maintenance: active --- # docopt-ng — Jazzband-maintained fork of docopt, the humane command line arguments parser. License: permissive · Maintenance: active · Downloads: 1.8M/mo ## 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 above — verify before relying. Parses command-line arguments and options from a docstring-based usage pattern, returning a dictionary of parsed arguments without requiring separate argument definitions. 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 pip install docopt-ng uv add docopt-ng poetry add docopt-ng ## Installing docopt-ng 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. 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) Requires Python 3.7 or later. 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_current - Install friction: low - Maintenance: active - Downloads: 1.8M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags command line argument parser, docstring-based CLI parser, parse command line options, CLI interface from docstring, argument parsing from help text, command line interface generator, docopt parser, cli-parsing, docstring-driven [View on SkillFed](https://skillfed.io/packages/docopt-ng) · [View on PyPI](https://pypi.org/project/docopt-ng/)