Writing documentation is every developer's least favorite task. So I built a tool that does it automatically.
The Problem
Python projects grow fast. Classes, functions, models, APIs — keeping docs in sync with code is tedious and easy to ignore until a new dev joins and has no idea what's going on.
The Solution
PyDocAI takes your Python code and:
Parses it using Python's ast module to extract classes, functions, models, fields, and endpoints
Sends the structured data to an AI model (Groq LLaMA, with Gemini/Claude fallbacks)
Generates clean Markdown documentation with tables, function signatures, and API specs
Tech Stack
Backend: Django 5 + Django REST Framework + Celery + Redis + PostgreSQL
Frontend: React 19 + Vite + TypeScript + Tailwind CSS
AI: Groq API (with fallbacks to Gemini and Claude)
Deployment: Vercel (frontend), AWS EC2 + RDS (backend)
How It Works
Users can upload code three ways:
Single .py file — quick analysis
.zip archive — upload a whole project folder
GitHub repo — connect via OAuth or public URL
The backend parses each file, extracts the AST, and queues an AI generation task. Once complete, the documentation is rendered as styled Markdown in the browser with syntax highlighting, Mermaid diagrams, and export support.
Key Learnings
Python's ast module is incredibly powerful for extracting structural code information
Prompt engineering matters — structuring the AST data properly before sending to the AI makes a huge difference in output quality
Celery + Redis handles long-running AI generation tasks smoothly
Try It Out
Live demo: https://pydocai.vercel.app GitHub: https://github.com/dennisjoseph2025/PyDocAI
It's open source (MIT). Contributions, issues, and stars are welcome!
Top comments (0)