Skip to main content

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

  • @readmebro Decorator → 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:7b for rich, contextual docs
  • JSON Registry → Store raw scan data in documentation/raw/.
  • 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/<your-username>/readmebro.git
cd readmebro
pip install -e .

⚡ Quick Start

from readmebro 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

📂 Output Structure

documentation/
  raw/
    readmebro_registry.json   # Captured code metadata
    readmebro_usage.json      # Usage mapping
    README_GENERATED.md       # Generated documentation
    function_graph.md         # Mapping of classes and functions

🖥 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!

  1. Fork the repo
  2. Create a feature branch (git checkout -b feature-name)
  3. Commit changes (git commit -m "Added feature")
  4. 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

readmebro-0.1.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

readmebro-0.1.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file readmebro-0.1.0.tar.gz.

File metadata

  • Download URL: readmebro-0.1.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for readmebro-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7306ceac7c2c7858b5659ac708dd24668de5ab39978fc6c9fa62498c5ac21078
MD5 b9000f49d03651b5dc8e1b24c66eaa23
BLAKE2b-256 1d83bd05f0f3ca1d3b015f4adcd200d4ee7c98ff213ed0b7ab9e3dbd271bbc63

See more details on using hashes here.

File details

Details for the file readmebro-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: readmebro-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for readmebro-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e5e9787129245a89fd6e053c254319c54b6cd7f725d4f43c3050836772676055
MD5 e609c10bb14c33f5f81b5af832e50aa2
BLAKE2b-256 c24d35e3e141b1c17207f50191d9b4810dc7d137573420a462c0b25096c1bde2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page