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, 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


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.2.0.tar.gz (22.1 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.2.0-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

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

Hashes for pydoc2markdown-0.2.0.tar.gz
Algorithm Hash digest
SHA256 54fd6687efccfbba42e12ccb991aaab20e2e0cc427d6368ce9aa1f2144f8d489
MD5 d14d8db66230ba0002eb85aee89b8191
BLAKE2b-256 100310d1241f8b1f5f8a9e10fa99a889c77d5e800c543e61ecd5daaa295e6488

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydoc2markdown-0.2.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.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

Hashes for pydoc2markdown-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 56c4a1aa485be731e4f08531a759212a9c10855d30097a7b1051046cf2f2a9c1
MD5 3ae02814a708108246fc0bb3a0ce5f01
BLAKE2b-256 2824ec82fc3844403b832418b6d375595970e7a25492aaa220d2ebbe809d6504

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydoc2markdown-0.2.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