docstring-to-markdown
On the fly conversion of Python docstrings to markdown
- Python 3.7+ (tested on 3.8 up to 3.13)
- can recognise reStructuredText and convert multiple of its features to Markdown
- since v0.13 includes initial support for Google-formatted docstrings
Installation
pip install docstring-to-markdown
Example
Convert reStructuredText:
>>> import docstring_to_markdown
>>> docstring_to_markdown.convert(':math:`\\sum`')
'$\\sum$'
When given the format cannot be recognised an exception will be raised:
>>> docstring_to_markdown.convert('\\sum')
Traceback (most recent call last):
raise UnknownFormatError()
docstring_to_markdown.UnknownFormatError
Extensibility
docstring_to_markdown entry point group allows to add custom converters which follow the Converter protocol.
The built-in converters can be customized by providing entry point with matching name.
Development
pip install -e .
pytest
Release files for docstring-to-markdown 0.17
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| docstring_to_markdown-0.17.tar.gz | 32.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| docstring_to_markdown-0.17-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 55.7 kB
Release files / docstring_to_markdown-0.17.tar.gz
| Download URL | docstring_to_markdown-0.17.tar.gz |
|---|---|
| Size | 32.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
df72a112294c7492487c9da2451cae0faeee06e86008245c188c5761c9590ca3
|
|
BLAKE2b-256 checksum How to use checksums |
52d88abe80d62c5dce1075578031bcfde07e735bcf0afe2886dd48b470162ab4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 2, 2025.
Transparency logRelease files / docstring_to_markdown-0.17-py3-none-any.whl
| Download URL | docstring_to_markdown-0.17-py3-none-any.whl |
|---|---|
| Size | 23.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd7d5094aa83943bf5f9e1a13701866b7c452eac19765380dead666e36d3711c
|
|
BLAKE2b-256 checksum How to use checksums |
567baf3d0da15bed3a8665419bb3a630585756920f4ad67abfdfef26240ebcc0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 2, 2025.
Transparency log