awesome-repositories.com
博客
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目关于排名机制媒体报道MCP 服务器
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
docopt avatar

docopt/docopt

0
View on GitHub↗
8,008 星标·558 分支·Python·MIT·2 次浏览

Docopt

Docopt 是一个命令行参数解析器和声明式接口工具,可将原始终端输入转换为结构化数据映射。它直接从标准化的 POSIX 风格帮助信息中推导解析逻辑和需求,将文档作为接口的正式规范。

该系统实现了 POSIX 用法模式解析器,将人类可读的帮助字符串转换为提取选项和位置参数的规则。它根据用户定义的内部用法模式自动生成帮助屏幕和版本信息。

该工具通过严格的参数和选项排序确保可预测的用户体验,防止在遇到位置参数后混入其他输入。它为命令行接口设计提供了完整的实现,通过将输入标记与预定义模式匹配来填充数据结构。

Features

  • Usage-Pattern-Based Parsing - Translates a formal help string into a set of rules for extracting options and positional arguments from input.
  • CLI Token Consumption - Processes the input stream sequentially to identify flags and arguments while adhering to specified order constraints.
  • CLI Token Matching - Matches raw command line tokens against defined usage patterns to populate a structured data map.
  • Declarative Argument Definitions - Defines CLI interfaces using a human-readable help message as a declarative source of truth instead of imperative logic.
  • Command Line Argument Parsers - Parses raw shell input strings into structured objects based on a predefined usage pattern.
  • POSIX Usage Parsers - Derives command-line logic and requirements directly from a standardized POSIX-style help message.
  • POSIX CLI Compliance - Creates command line tools that follow standard POSIX conventions for flags and arguments.
  • CLI Specification Design - Defines how a program accepts user inputs by writing a clear usage message that the system automatically parses.
  • Strict Argument Ordering - Ensures all options appear before positional arguments to prevent mixing inputs and ensure predictable command parsing.
  • Command Help Displays - Displays formatted help screens and version information when specific command flags are provided.
  • Help Generators - Automatically generates terminal-friendly documentation and version information from the internal usage specification.
  • Help Text Generators - Automatically constructs and formats instructional help documentation based on the parsed usage patterns.
  • Strict Option Sequencing - Stops accepting options once the first positional argument is encountered to maintain a strict sequence of command inputs.
  • CLI Development - Creates command-line interfaces based on usage documentation strings.
  • Python CLI Frameworks - Pythonic argument parser based on help messages.

Star 历史

docopt/docopt 的 Star 历史图表docopt/docopt 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

Docopt 的开源替代方案

相似的开源项目,按与 Docopt 的功能重合度排序。
  • commandlineparser/commandlinecommandlineparser 的头像

    commandlineparser/commandline

    4,817在 GitHub 上查看↗

    This library is a .NET command line parser for C# and F# that implements POSIX getopt conventions to map shell arguments into strongly typed objects. It provides a framework for building console applications that process Unix-style flags and options. The project features a routing system that directs program execution based on action-oriented verbs, supporting sub-commands and default actions. It includes an automatic help generator that produces localized usage instructions and formatted help screens based on the defined command options. The toolset covers argument parsing with strongly typ

    C#command-linedotnetdotnet-core
    在 GitHub 上查看↗4,817
  • remkop/picocliremkop 的头像

    remkop/picocli

    5,387在 GitHub 上查看↗

    picocli is a command line interface development framework and argument parser for JVM-based applications. It maps command line options and positional parameters to strongly typed Java methods and fields using a declarative, annotation-based model. The framework provides specific support for native image compilation, producing the reflection and resource configuration files necessary to build standalone binaries with reduced startup overhead. It further distinguishes itself with a dedicated system for generating shell autocompletion scripts and an ANSI terminal stylizer for applying colors and

    Java
    在 GitHub 上查看↗5,387
  • fastapi/typerfastapi 的头像

    fastapi/typer

    19,632在 GitHub 上查看↗

    This project is a Python framework for building command-line interfaces by converting standard functions into executable programs. It uses type hints to automatically infer and generate argument parsers, validation logic, and help documentation, allowing developers to define complex terminal applications through simple function signatures. The framework distinguishes itself through a decorator-driven registration system that enables the construction of hierarchical command trees. It supports dependency injection to manage shared state and runtime configuration across subcommands, and it utili

    Pythoncliclickpython
    在 GitHub 上查看↗19,632
  • pallets/clickpallets 的头像

    pallets/click

    17,560在 GitHub 上查看↗

    Click is a Python framework for building command-line interfaces. It provides a declarative approach to defining command structures, allowing developers to map functions to command-line arguments, options, and nested groups using decorators. The framework handles the complexities of parameter parsing, type validation, and help documentation generation automatically. The project distinguishes itself through its hierarchical context system, which propagates configuration and state across nested commands, and its environment-aware parameter resolution that prioritizes command-line inputs, enviro

    Pythoncliclickpallets
    在 GitHub 上查看↗17,560
查看 Docopt 的所有 30 个替代方案→

常见问题解答

docopt/docopt 是做什么的?

Docopt 是一个命令行参数解析器和声明式接口工具,可将原始终端输入转换为结构化数据映射。它直接从标准化的 POSIX 风格帮助信息中推导解析逻辑和需求,将文档作为接口的正式规范。

docopt/docopt 的主要功能有哪些?

docopt/docopt 的主要功能包括:Usage-Pattern-Based Parsing, CLI Token Consumption, CLI Token Matching, Declarative Argument Definitions, Command Line Argument Parsers, POSIX Usage Parsers, POSIX CLI Compliance, CLI Specification Design。

docopt/docopt 有哪些开源替代品?

docopt/docopt 的开源替代品包括: commandlineparser/commandline — This library is a .NET command line parser for C# and F# that implements POSIX getopt conventions to map shell… remkop/picocli — picocli is a command line interface development framework and argument parser for JVM-based applications. It maps… fastapi/typer — This project is a Python framework for building command-line interfaces by converting standard functions into… pallets/click — Click is a Python framework for building command-line interfaces. It provides a declarative approach to defining… google/python-fire — Python Fire is a library that automatically generates command line interfaces from any Python object, function, or… cliutils/cli11 — CLI11 is a header-only C++ library for parsing command line arguments and managing configuration files. It maps shell…