Skip to main content

Pull argparse configuration out of a CLI tool and write it as Markdown. Great for embedding in a README.md with cog.

Project description

Pull argparse configuration out of a CLI tool and write it as Markdown.

Great for embedded in a README.md with cog.

Usage

Possible invocation options:

# entrypoint command, dotted module
uv tool run argparse-help-markdown -m tests.data.example

# script, script
argparse_help_markdown.py --write.md script.py

# import, function
from argparse_help_markdown import run_script
run_script("mytool.py", include_usage=True)

What it does

It writes this table about itself:

usage: argparse_help_markdown.py script.py
Options Values Help
positional arguments
filename
Optional. Path to the subject script.
options
-h --help
Flag. show this help message and exit
--usage
Flag. Emit the terse usage info in triple-ticks. Excluded by default.
--write
Optional. Write to named file instead of stdout.
-m --module
Optional. Run as module.

Installation, or not

This is built as a single-file that can be installed as a package or used standalone. It can be imported as a module or run on the command-line. It's mostly useful inside a documentation CICD pipeline, where flexability is key. No dependencies outside of standard library.

With uv: uv tool run argparse-help-markdown

With pipx: pipx run argparse-help-markdown

Or install with pip: pip install argparse-help-markdown

Or grab a locked version with curl: curl -O https://raw.githubusercontent.com/ellieayla/argparse-help-markdown/a35c9ea9cd975575adb45a4cbbf3d140adf04269/src/argparse_help_markdown.py; python3 argparse_help_markdown.py

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

argparse_help_markdown-0.1.3-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file argparse_help_markdown-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for argparse_help_markdown-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6c6d34e0c1512faffe30dc9cf648eb29e4569a62b04bde39e3bcf3a97da9748b
MD5 149e9c299af9ebaa88bb1e6978c2a86a
BLAKE2b-256 c964604994c688b36e2ce54f70836b7dbc14f093c3e9f7fb5a1df68a7fdbbc4d

See more details on using hashes here.

Provenance

The following attestation bundles were made for argparse_help_markdown-0.1.3-py3-none-any.whl:

Publisher: publish.yaml on ellieayla/argparse-help-markdown

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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