AI-powered and AI-optional Python documentation generator
Project description
📚 ReadMeBro
ReadMeBro is an AI-powered (and AI-optional) documentation assistant for Python codebases.
It automatically scans your repository, finds functions and classes, detects where they are used, and generates clear, concise documentation.
You can use it with AI (via Ollama + CodeLlama) or without AI for a plain text README.
🚀 Features
@readmebroDecorator → Capture metadata of functions and classes.- Usage Mapping → Find where each function/class is used in your codebase.
- Two Documentation Modes:
- Without AI → Generate standard documentation with
readmebro generate - With AI → Use
readmebro generate --llm ollama --model codellama:7bfor rich, contextual docs
- Without AI → Generate standard documentation with
- JSON Registry → Store raw scan data in
documentation/raw/. - Function Graph → Auto-generate a visual map of how functions connect.
- Minimal Setup → Works out of the box with or without AI.
📦 Installation
pip install readmebro
Or install directly from source:
git clone https://github.com/samartha-siddhartha/readmebro.git
cd readmebro
pip install -e .
⚡ Quick Start
from readmebro.decorator import readmebro
@readmebro
def add_numbers(a, b):
"""Simple addition function"""
return a + b
1️⃣ Run your Python code at least once
This ensures the @readmebro decorator captures the function/class in the registry.
2️⃣ Scan your repository for usage
readmebro scan
3️⃣ Generate documentation
🔹 Generate Documentation Without AI
readmebro generate
This will create a basic README_GENERATED.md from captured metadata.
🔹 Generate AI-Powered Documentation (Recommended: CodeLlama)
First, install Ollama and pull the CodeLlama model:
ollama pull codellama:7b
Then run:
readmebro generate --llm ollama --model codellama:7b
⚠️ Note: ReadMeBro uses the local Ollama HTTP API via
requests(default:http://localhost:11434). No external servers are contacted unless you configure Ollama otherwise.
📂 Output Structure
documentation/
raw/
readmebro_registry.json # Captured code metadata
readmebro_usage.json # Usage mapping
README_GENERATED.md # Generated documentation
function_graph.md # Mermaid function graph
function_graph.html # Interactive graph (pyvis)
🔗 Workflow Overview
graph TD
A[Run your Python code] --> B[readmebro scan]
B --> C[Usage & registry JSON]
C --> D[readmebro generate]
D --> E[README_GENERATED.md]
D --> F[Function Graphs]
F --> G[Mermaid + PyVis visualizations]
🖥 Requirements
- Python 3.8+
- (Optional) Ollama installed locally → Install Ollama
- (Optional) Model downloaded for AI docs (recommended: CodeLlama 7B):
ollama pull codellama:7b
📌 Commands
readmebro scan
readmebro generate
readmebro generate --llm ollama --model codellama:7b
🤝 Contributing
We welcome contributions!
- Fork the repo
- Create a feature branch (
git checkout -b feature-name) - Commit changes (
git commit -m "Added feature") - Push and create a Pull Request
📜 License
MIT License — Feel free to use and modify.
Made with ❤️ + 🦙 by Samartha Siddhartha
---
If you want, I can **add a workflow diagram** showing:
`Run code → readmebro scan → readmebro generate`
so that users can see the steps visually inside the README.
That would make it extra intuitive for first-time users.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file readmebro-1.2.0.tar.gz.
File metadata
- Download URL: readmebro-1.2.0.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3e9c2776837f7fc2232522a7e09e8ab63c1f0297ebdd401061298540307b6f3
|
|
| MD5 |
29c1cd14de4af397934647ead50d0c4d
|
|
| BLAKE2b-256 |
1b771483696e84729626ba231244239a8ae08172d8170296e6f2bc5484b66d8b
|
File details
Details for the file readmebro-1.2.0-py3-none-any.whl.
File metadata
- Download URL: readmebro-1.2.0-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a75bf7df1e14230ab25db6fb1350ea9d19b25395cabc59fcfa3e23b21e8948ac
|
|
| MD5 |
bc044e5bf74ff7078d39f8e883efdc99
|
|
| BLAKE2b-256 |
b9d5e74103ef13f6a2b895a21940aaa47b47f4a5a094051be3b4b55f4c63ce38
|