AI-powered Markdown documentation generator for Python projects.
AutoDocGen scans your Python source code, extracts docstrings and structure using Python's built-in AST parser, and uses AI to generate comprehensive, readable Markdown documentation — one file per module plus a navigable index.
- Multi-Provider Support — Works with OpenRouter, Groq, Google Gemini, and OpenAI.
- AST-based parsing — No fragile regex. Uses Python's
astmodule to accurately extract modules, classes, methods, and functions. - Jinja2 Templates — Clean, customizable Markdown output using industry-standard templates.
- Async function support — Correctly identifies and labels
async deffunctions. - Cross-module linking — Automatically traces imports to create related module links.
- Navigable index — Produces a comprehensive
index.md. - Flexible configuration — Supports
.env,autodocgen.yaml,pyproject.toml, and CLI flags.
pip install pypiautodocgenpip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pypiautodocgengit clone https://github.com/shifulegend/autodocgen
cd autodocgen
pip install .Set your API keys in a .env file (which is gitignored):
OPENAI_API_KEY=sk-...
GROQ_API_KEY=gsk_...
OPENROUTER_API_KEY=sk-or-...
GOOGLE_API_KEY=AIza...llm:
provider: groq
model: llama-3.1-8b-instant
output:
dir: docs
source:
- autodocgen# Generate docs using settings from autodocgen.yaml
autodocgen . --verbose
# Override provider/model via CLI
autodocgen . --output docs_custom -v- Multi-provider LLM support (OpenRouter, Groq, Gemini)
- Jinja2 template-based rendering
- Async AI calls for faster generation
- Incremental generation (skip unchanged files)
- HTML and reStructuredText output formats
MIT — Copyright (c) 2025-2026 AutoDocGen Team