Convert Python docstrings to Markdown documentation.
Project description
PyDoc2Markdown
Convert Python docstrings into clean, structured Markdown documentation.
Features
- Docstring parsing — Extract Google, NumPy, and reStructuredText style docstrings with structured params, returns, and raises.
- Markdown generation — Produce beautiful Markdown files with customizable Jinja2 templates.
- Auto-generated index & TOC — Each module gets a Table of Contents; an
index.mdwith package grouping is created automatically. - Package grouping — Output files are organized into subdirectories matching the package structure.
- Built-in themes — Choose between
default(detailed) andminimalthemes, or supply your own template. - CLI & API — Use via command line or import as a Python library.
- Recursive processing — Scan entire packages in one command.
- Type-aware — Respects type hints and annotations.
- Advanced constructs — Supports
property,classmethod,staticmethod,dataclass,Enum,TypedDict, and__all__.
Installation
pip install pydoc2markdown
Quick Start
CLI Usage
# Generate docs for a single file
pydoc2markdown my_module.py -o docs
# Recursively process a package
pydoc2markdown src/my_package --recursive -o docs
# Use a built-in theme
pydoc2markdown src/my_package --recursive --theme minimal -o docs
# Use a custom template
pydoc2markdown src/my_package --recursive --template custom.md.j2 -o docs
# Enable verbose logging
pydoc2markdown src/my_package --recursive -vv -o docs
Library Usage
from pathlib import Path
from pydoc2markdown import DocstringParser, MarkdownGenerator
parser = DocstringParser()
modules = parser.parse(Path("src/my_package"), recursive=True)
generator = MarkdownGenerator(theme="default")
generator.generate(modules, output_dir=Path("docs"))
Documentation
License
MIT License — see LICENSE for details.
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 pydoc2markdown-0.2.0.tar.gz.
File metadata
- Download URL: pydoc2markdown-0.2.0.tar.gz
- Upload date:
- Size: 22.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54fd6687efccfbba42e12ccb991aaab20e2e0cc427d6368ce9aa1f2144f8d489
|
|
| MD5 |
d14d8db66230ba0002eb85aee89b8191
|
|
| BLAKE2b-256 |
100310d1241f8b1f5f8a9e10fa99a889c77d5e800c543e61ecd5daaa295e6488
|
Provenance
The following attestation bundles were made for pydoc2markdown-0.2.0.tar.gz:
Publisher:
release.yml on f1sherFM/PyDoc2Markdown
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydoc2markdown-0.2.0.tar.gz -
Subject digest:
54fd6687efccfbba42e12ccb991aaab20e2e0cc427d6368ce9aa1f2144f8d489 - Sigstore transparency entry: 1632755491
- Sigstore integration time:
-
Permalink:
f1sherFM/PyDoc2Markdown@6fb632b7a11b4e2be4c950303adffb3ad89a0f3e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/f1sherFM
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6fb632b7a11b4e2be4c950303adffb3ad89a0f3e -
Trigger Event:
push
-
Statement type:
File details
Details for the file pydoc2markdown-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pydoc2markdown-0.2.0-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56c4a1aa485be731e4f08531a759212a9c10855d30097a7b1051046cf2f2a9c1
|
|
| MD5 |
3ae02814a708108246fc0bb3a0ce5f01
|
|
| BLAKE2b-256 |
2824ec82fc3844403b832418b6d375595970e7a25492aaa220d2ebbe809d6504
|
Provenance
The following attestation bundles were made for pydoc2markdown-0.2.0-py3-none-any.whl:
Publisher:
release.yml on f1sherFM/PyDoc2Markdown
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydoc2markdown-0.2.0-py3-none-any.whl -
Subject digest:
56c4a1aa485be731e4f08531a759212a9c10855d30097a7b1051046cf2f2a9c1 - Sigstore transparency entry: 1632755497
- Sigstore integration time:
-
Permalink:
f1sherFM/PyDoc2Markdown@6fb632b7a11b4e2be4c950303adffb3ad89a0f3e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/f1sherFM
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6fb632b7a11b4e2be4c950303adffb3ad89a0f3e -
Trigger Event:
push
-
Statement type: