Skip to main content

Tool for creating command line interfaces derived from numpy style doc strings.

Project description

npdoc-cli

A tool built with argparse that utilizes the numpy style guide to generate a command line interface (CLI). Paired with auto-generated documentation with sphinx you can maintain a function's source code, documentation, and CLI all with the same chunk of text.

For example a simple CLI for a function can be made with:

from npdoc_cli import cli

@cli.program
def hello(name: str):
    """
    Say hello!

    Parameters
    ----------
    name : str
        Who is being greeted.
    """
    print('hello', name)

cli.build()
cli.print_help()

Which produces a help message like:

usage: hello [-h] name

Say hello!

positional arguments:
  name        Who is being greeted.

optional arguments:
  -h, --help  show this help message and exit

Install with pip.

pip install npdoc-cli

For more information, check out the documentation.

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

npdoc_cli-0.0.2.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

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

npdoc_cli-0.0.2-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file npdoc_cli-0.0.2.tar.gz.

File metadata

  • Download URL: npdoc_cli-0.0.2.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for npdoc_cli-0.0.2.tar.gz
Algorithm Hash digest
SHA256 5db1f8cc4a6141b956dd3e1513b66da1d46121fbd12f5c878937724dd30c9820
MD5 df259dedd4016c706606efb7c0ca3f07
BLAKE2b-256 6e46e0dc091ff6ea7cf78d51da87caeb053d0f87510fc05371e7d9e17f567fc9

See more details on using hashes here.

File details

Details for the file npdoc_cli-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: npdoc_cli-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for npdoc_cli-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b27e09145962e9803c98e77582129d6e448e10ac880549a23e1328ada03cec36
MD5 19ef41b08949d426d51ad88d03b5fff1
BLAKE2b-256 dfbe28b747fc34bfc6650ba34cc3bea21fe94790bb5a831d2cd7b9a7b83761ca

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