Skip to main content

Convert Python docstrings to Markdown documentation.

Project description

PyDoc2Markdown

CI codecov PyPI

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.1.0.tar.gz (20.4 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.1.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pydoc2markdown-0.1.0.tar.gz
Algorithm Hash digest
SHA256 453f163d4cf1915e8966f26d84382e76854325409ea519b5c2da2eaa26694151
MD5 c85d2ab01e72796299ac589c4fe3e9c0
BLAKE2b-256 df6b3d55015d7066e2468f96b5016ac32fd6118b42b9e173bd7e4cd3fcb881e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydoc2markdown-0.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: pydoc2markdown-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.9 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 041b07412db5e6294317f420780d3a28b4bd58e8e39f77130f47813b45882b88
MD5 09b80110bb1f53943e4d10532c2dc2f2
BLAKE2b-256 fd88b6c620ab41a94d5d63ff963490d88d83eec1eb400f56591e0cdbca43e937

See more details on using hashes here.

Provenance

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