Skip to main content

Markdownizer

Extract existing documentation from Python projects into Markdown.

CI PyPI Python License: MIT

Markdownizer never generates, rewrites, summarizes, or improves documentation. It only extracts what is already present in your source code: docstrings, comments, decorators, and source.

Installation

pip install markdownizer

Or with pipx for an isolated CLI:

pipx install markdownizer

Requires Python 3.9+. No runtime dependencies.

Usage

CLI

markdownizer /path/to/project -o ./docs

This recursively scans the project, parses every Python file with the AST, and writes one Markdown file per package into ./docs.

Common options:

markdownizer . -o ./docs \
  --exclude "tests/*" --exclude "migrations" \
  --only-documented --no-source
Option Description
-o, --output DIR Output directory (default: ./docs)
--root-name NAME Filename for files at the project root (default: _root)
--exclude GLOB Skip matching paths; may be repeated
--no-source Omit the ## Source Code section
--no-comments Omit the ## Comments section
--only-documented Only include objects with a docstring
-v, --verbose Increase logging verbosity
-q, --quiet Suppress non-error output
--version Show the version

Run markdownizer --help for the full list.

Python API

from pathlib import Path
from markdownizer import extract_project

written = extract_project(
    Path("."),
    Path("docs"),
    exclude=["tests/*"],
    include_source=False,
)
print(written)  # list of written Markdown files

What is extracted

For every documented object (modules, packages, classes, dataclasses, enums, functions, async functions, methods, properties, Django models, Django forms, Django admin classes, DRF serializers, DRF viewsets, signals, middleware, management commands, URL configuration, and any other object with a docstring):

  • The docstring, verbatim
  • Comments that belong to the object (preceding and inline)
  • Decorators
  • The complete source code

Output format

Each generated Markdown file groups all modules inside a single package and uses specialized headers such as:

# Django Model: User
# DRF Serializer: UserSerializer
# DRF ViewSet: UserViewSet
# Enum: Status
# Dataclass: Point
# Async Function: fetch_data

Every section preserves the original formatting of the source documentation.

Development

See CONTRIBUTING.md for setup, checks, and release steps. Changes are recorded in CHANGELOG.md.

License

MIT — see LICENSE.

Release files for markdownizer 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for markdownizer 0.2.1
File Size Uploaded
markdownizer-0.2.1.tar.gz 19.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for markdownizer 0.2.1
File Interpreter ABI Platform
markdownizer-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 34.1 kB

Release files / markdownizer-0.2.1.tar.gz

Download URL markdownizer-0.2.1.tar.gz
Size 19.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a0cfec5260158a3fcea2d1c0e838998db776d45ba78163eef2e2733e68e7c42c
BLAKE2b-256 checksum
How to use checksums
1f5db8a99d5ca6d7c92b72565d8be26e3759faeea443018151c249aff4b4ca54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 28, 2026.

Transparency log

Release files / markdownizer-0.2.1-py3-none-any.whl

Download URL markdownizer-0.2.1-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1aecf8179674ddc3afefb9f7736df88e4723d562e43e00e897fb98a7e407e238
BLAKE2b-256 checksum
How to use checksums
e76ad6232e76dd2b7967741ebcf9d8c5ff083e3811d5deb06a20c976a86fe871
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 28, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

This release

0.2.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page