Skip to main content

pydoc_fork

A fork of pydoc to optimize it for generating, on a build server, html documentation for a python library you wrote.

Less ambitious than the very good pdoc3 and easier to use than Sphinx. Not as pretty as either. But it works, it's small, and the output looks like the pydoc you remember from 2003 (now with themes).

Installation

Requires Python 3.10+

pip install pydoc_fork

# or virtual environment access
pipenv install pydoc_fork

# WARNING- installation by pipx will only allow for doc generation of the python standard library!
pipx install pydoc_fork

Usage

# Generate HTML for all modules and submodules from source code
pydoc_fork my_module --output docs --document_internals

# Generate HTML for a module that is importable, e.g. sys
pydoc_fork sys --output docs

# Pick a theme and label the project
pydoc_fork my_module --output docs --theme dark --project_name "My Cool Lib"

# Link to docs.python.org for stdlib references instead of regenerating them
pydoc_fork my_module --output docs --prefer_docs_python_org

# Skip the index.html (e.g. you have your own landing page)
pydoc_fork my_module --output docs --no_index

# Use a pyproject.toml for configuration (see "Config" below)
pydoc_fork my_module --output docs --config .

# Launch the (extremely minimal) Tk GUI
pydoc gui

Run pydoc_fork --help for the full list of flags.

Config via pyproject.toml

Anything you can pass on the command line you can also stash under [tool.pydoc_fork] in a pyproject.toml and point at it with --config <dir>:

[tool.pydoc_fork]
PROJECT_NAME = "My Cool Lib"
THEME = "dark"
DOCUMENT_INTERNALS = true
PREFER_DOCS_PYTHON_ORG = true
GENERATE_INDEX = true
SKIP_MODULES = ["typing"]
# CUSTOM_TEMPLATES = "./my_templates"  # optional, see below

Themes

Three themes ship in the box. They are CSS variables on a :root block, so if you want to tweak one, fork pydoc_fork/reporter/themes.py — it's a single dict.

Theme Vibe
classic The original pydoc look: lavender, pink, purple.
light A calmer modern light theme.
dark A modern dark theme for people who code at night.
pydoc_fork my_module --output docs --theme light

Templating

Output is rendered through Jinja2 templates that live in pydoc_fork/templates/:

class.jinja2          function.jinja2    module.jinja2
data.jinja2           heading.jinja2     multicolumn.jinja2
disabled_text.jinja2  index.jinja2       page.jinja2
fallback.jinja2       section.jinja2

If you want to change the layout, copy that folder somewhere, edit, and point CUSTOM_TEMPLATES at it in your pyproject.toml. (The plumbing for swapping the Jinja loader is in pydoc_fork/reporter/jinja_code.py — keep it minimal.)

Publishing to GitHub Pages

A compact workflow that generates docs into ./site on every push to main and publishes them. Drop it at .github/workflows/docs.yml:

name: docs
on:
  push:
    branches: [main]
permissions:
  contents: read
  pages: write
  id-token: write
jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    environment:
      name: github-pages
      url: ${{ steps.deploy.outputs.page_url }}
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with: { python-version: "3.12" }
      - run: pip install . pydoc_fork
      - run: pydoc_fork my_module --output site --theme light --project_name "My Cool Lib"
      - uses: actions/upload-pages-artifact@v3
        with: { path: site }
      - id: deploy
        uses: actions/deploy-pages@v4

One-time setup: in your repo, Settings → Pages → Build and deployment → Source: GitHub Actions. After the first successful run the URL will appear at the top of the Pages settings panel and in the workflow summary.

Docs

pydoc_fork documented in several ways

Because the best way to evaluate a doc generator is to see it run on the same codebase as its peers:

Prior art and alternatives

pydoc_fork exists because none of these were quite the right shape for "generate API HTML on a build server and forget about it." They are all, however, excellent at what they do — try them first.

  • pydoc — the stdlib original. The direct ancestor of this fork. Great for pydoc -p 0 at a REPL; awkward for "render all of my package to a folder of HTML in CI."
  • pdoc3 / pdoc — the closest peers. Nicer output, more features, more configuration surface. If you want the output to look modern out of the box, start here.
  • Sphinx — the heavyweight. Unmatched for narrative documentation, cross-references, and multi-format output. Has a learning curve, a conf.py, an index.rst, themes, extensions, and opinions. Worth it for large projects.
  • MkDocs + mkdocstrings — Markdown-first sites with API docs injected via ::: module.name. Lovely output (especially with the Material theme), but it is a site generator first and an API extractor second.
  • pdocs / portray — Timothy Crosley's duo. Portray is "MkDocs + pdocs + zero config" — very nice if your project fits the mold.
  • PyDoctor — the original API doc tool for Twisted. Strict about docstring formatting, produces dense reference output.
  • Pycco — literate-style side-by-side source/docs. Different goal, but worth knowing about.
  • Doxygen — yes, it does Python. No, you probably don't want it for Python.
  • Read the Docs — not a generator but a hosting platform; pairs with Sphinx or MkDocs. The "obvious" alternative to the GitHub Pages workflow above.

If you are starting a new project and want something modern with a thriving community, pick pdoc or mkdocstrings. If you want output that screams "this is the API and nothing else, rendered the way pydoc has always rendered it" and you want to call it from a one-line shell script in CI, this fork is for you.

Credits

Forked from pydoc in python 3.10.

That code is governed by the cpython license

I picked a MIT license, but I'm no lawyer, the cpython license probably governs in any conflict.

Metadata

Release files for pydoc-fork 3.4.0

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

Source distribution (sdist)

Source distribution for pydoc-fork 3.4.0
File Size Uploaded
pydoc_fork-3.4.0.tar.gz 85.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pydoc-fork 3.4.0
File Interpreter ABI Platform
pydoc_fork-3.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 133.8 kB

Release files / pydoc_fork-3.4.0.tar.gz

Download URL pydoc_fork-3.4.0.tar.gz
Size 85.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b9fd3035d66ac81aff1d3bb51febebb49ca821ea1b582b1bc4bf34b487731287
BLAKE2b-256 checksum
How to use checksums
cd1c20ba0e3ddb78f873f1cc60553e8a500f29d4cef891526e6e4c1cc60caf23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 May 24, 2026.

Transparency log

Release files / pydoc_fork-3.4.0-py3-none-any.whl

Download URL pydoc_fork-3.4.0-py3-none-any.whl
Size 48.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aebd96098a50b35c90c7d4cb626f33f79eac92533ca18d55c2a82abfa3e6d0af
BLAKE2b-256 checksum
How to use checksums
22f2304f144279d858eb2576095b14529c50a912da806932bb1956e1c014c5eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 May 24, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

3.4.0 This release

2 release files

3.3.0

2 release files

3.2.0

2 release files

3.1.14

1 release file

3.1.13

1 release file

3.1.9

1 release file

3.1.8

1 release file

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