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
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 argparse_help_markdown-0.1.4-py3-none-any.whl.
File metadata
- Download URL: argparse_help_markdown-0.1.4-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8740e0fa2f465b97b9364d2e398617dc4c4686c79584cbbf90e45513e0e1c3c4
|
|
| MD5 |
5e07495f9e07bbe2345f685745a7f398
|
|
| BLAKE2b-256 |
3c552824b9747d4fc58696ccf3849b7beedb3e6cc25a6efb46264534cdb0a1a9
|
Provenance
The following attestation bundles were made for argparse_help_markdown-0.1.4-py3-none-any.whl:
Publisher:
publish.yaml on ellieayla/argparse-help-markdown
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
argparse_help_markdown-0.1.4-py3-none-any.whl -
Subject digest:
8740e0fa2f465b97b9364d2e398617dc4c4686c79584cbbf90e45513e0e1c3c4 - Sigstore transparency entry: 1113654926
- Sigstore integration time:
-
Permalink:
ellieayla/argparse-help-markdown@ad4d60be6918043a9611f1ea55a2dffb6fc10816 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/ellieayla
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@ad4d60be6918043a9611f1ea55a2dffb6fc10816 -
Trigger Event:
push
-
Statement type: