Skip to main content

A Python command line arg parser, and usage instructions generator

Project description

For authors of command-line utilities. Simplifies: 1) Defining command-line options and parameters, 2) Parsing the command line, and 3) Displaying usage instructions to the console.

Utility developers will 1) Subclass a module-defined class, 2) Include a YAML spec in the subclass to define the utility’s options and usage, and 3) Invoke the module arg parser. When the utility is run, if the command line is valid according to the YAML schema, then the supplied args are injected into the subclass by the parser. Otherwise errors are automatically displayed to the console.

If the user specifies ‘-h’ or ‘–help’ on the command line, then usage instructions are displayed as defined in the YAML, in a form generally recognizable to users of console utilities. Specifically, displays summary usage, detailed options and params (including categorized options), positional params, and examples.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycmdparse-1.0.0.tar.gz (28.0 kB view hashes)

Uploaded Source

Built Distribution

pycmdparse-1.0.0-py3-none-any.whl (27.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page