Skip to main content

render CLI arguments (sub-commands friendly) defined by argparse module

Project description

sphinx-argparse-cli

PyPI PyPI - Implementation PyPI - Python Version PyPI - Downloads PyPI - License check codecov Code style: black

Render CLI arguments (sub-commands friendly) defined by the argparse module. For live demo checkout the documentation of tox and mdpo.

installation

python -m pip install sphinx-argparse-cli

enable in your conf.py

# just add it to your list of extensions to load within conf.py
extensions = ["sphinx_argparse_cli"]

use

Within the reStructuredText files use the sphinx_argparse_cli directive that takes, at least, two arguments:

Name Description
module the module path to where the parser is defined
func the module path to where the parser is defined
prog (optional) the module path to where the parser is defined
title (optional) when provided, overwrites the <prog> - CLI interface title added by default and when empty, will not be included
usage_width (optional) how large should usage examples be - defaults to 100 character

For example:

.. sphinx_argparse_cli::
  :module: a_project.cli
  :func: build_parser
  :prog: my-cli-program

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

sphinx_argparse_cli-1.4.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinx_argparse_cli-1.4.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_argparse_cli-1.4.0.tar.gz.

File metadata

  • Download URL: sphinx_argparse_cli-1.4.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for sphinx_argparse_cli-1.4.0.tar.gz
Algorithm Hash digest
SHA256 341891a47290509c0b90f4357059781fc0aa03ec9e1f24ab76e9ba1b4bf155d7
MD5 2d32e84a10bd8982ce53b35bd500cb98
BLAKE2b-256 773e4f67161eb4152b0fa518e7bd909c70626b1b0124a040905b7776e2356eba

See more details on using hashes here.

File details

Details for the file sphinx_argparse_cli-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: sphinx_argparse_cli-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for sphinx_argparse_cli-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0fe2f7f432c9bb39831dcef313f721261b97b426bcf6403edb2aefab6435f4a6
MD5 aef2a00559964d6c02196259f0d58441
BLAKE2b-256 1d8ff1e98d0052e03acb46c80c4374c7d1288deedf9c6379c7b8288351a0ff3a

See more details on using hashes here.

Supported by

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