sphinx-argparse¶
sphinx-argparse is an extension for Sphinx that allows for easy generation of documentation for command line tools using Python’s argparse library.
Installation¶
This extension works with Python 3.10 or later and Sphinx 5.1 or later.
The package is available in the Python Package Index:
pip install sphinx-argparse
And also in conda-forge:
mamba -c conda-forge install sphinx-argparse
Enable the extension in your sphinx config:
extensions = [
...,
'sphinxarg.ext',
]
Contribute¶
Any help is welcome!
Most wanted:
Additional features
Bug fixes
Examples
Contributions are gratefully accepted through GitHub pull requests. Please report any bugs as issues on GitHub.
Don’t forget to run tests before committing:
pytest
Similar projects¶
https://github.com/tox-dev/sphinx-argparse-cli
A different
argparse-to-docs converter released in 2021, with a similar result assphinx-argparsebut with very different workings. The project is still actively being developed by the Tox team. This discussion highlights the difference: https://github.com/tox-dev/sphinx-argparse-cli/discussions/262https://github.com/sphinx-contrib/autoprogram
A predecessor to
sphinx-argparse, released in 2014 but not updated since 2024.