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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5db1f8cc4a6141b956dd3e1513b66da1d46121fbd12f5c878937724dd30c9820
|
|
| MD5 |
df259dedd4016c706606efb7c0ca3f07
|
|
| BLAKE2b-256 |
6e46e0dc091ff6ea7cf78d51da87caeb053d0f87510fc05371e7d9e17f567fc9
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b27e09145962e9803c98e77582129d6e448e10ac880549a23e1328ada03cec36
|
|
| MD5 |
19ef41b08949d426d51ad88d03b5fff1
|
|
| BLAKE2b-256 |
dfbe28b747fc34bfc6650ba34cc3bea21fe94790bb5a831d2cd7b9a7b83761ca
|