Skip to main content

Convert Python docstrings to Markdown documentation.

Project description

PyDoc2Markdown

CI codecov PyPI Python versions License

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.md with package grouping is created automatically.
  • Package grouping — Output files are organized into subdirectories matching the package structure.
  • Built-in themes — Choose between default (detailed) and minimal themes, 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, Protocol, ABC, 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

# Single combined file
pydoc2markdown src/my_package --recursive --single-file -o docs/README.md

# Watch mode — auto-regenerate on changes
pydoc2markdown src/my_package --recursive --watch -o docs

# Enable verbose logging
pydoc2markdown src/my_package --recursive -vv -o docs

See examples/docs/ for a sample of the generated output.

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


Download files

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

Source Distribution

pydoc2markdown-0.3.0.tar.gz (29.5 kB view details)

Uploaded Source

Built Distribution

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

pydoc2markdown-0.3.0-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file pydoc2markdown-0.3.0.tar.gz.

File metadata

  • Download URL: pydoc2markdown-0.3.0.tar.gz
  • Upload date:
  • Size: 29.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pydoc2markdown-0.3.0.tar.gz
Algorithm Hash digest
SHA256 3c0a9309038f62637bcaba993398578d0ae4b4d17ad56f34babe24ca8488da1a
MD5 0e9cbcda3f92bf1c8fcfcda94dd8f816
BLAKE2b-256 e9e334f001ab60840250250f0f04e189062dbf5029cf64eed64d599f733202b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydoc2markdown-0.3.0.tar.gz:

Publisher: release.yml on f1sherFM/PyDoc2Markdown

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

File details

Details for the file pydoc2markdown-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pydoc2markdown-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pydoc2markdown-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7b9df21ae92a96ff6710df9bd927117a6d1521c83fcbe5650c9814a75b2c2ec
MD5 ee68d6b047eb0e240695193d27b59fc3
BLAKE2b-256 84cf335329c67d33ec2c2852f67916e870b1bc6dae78e4aa5966dcbeda07b5fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydoc2markdown-0.3.0-py3-none-any.whl:

Publisher: release.yml on f1sherFM/PyDoc2Markdown

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