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.1.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.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: readmebro-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 25b9d19ca43944873a9202be609f82dfa835114711fdad2d79eb3ecc03a57342
MD5 eaeeba65f3640a6eb505e4ae99860ac4
BLAKE2b-256 7cee04a27cfe86814ae63a51bae0732e2141f598af013352f74dfdf2bd67346b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: readmebro-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aedf2f940e2f73657582f3e00212fae26856c55227cc6359cd119bb6540d072d
MD5 59673a9c93ce72c03f7d09481fd8ff80
BLAKE2b-256 ae7818ff3bf80c153635d3b897a702539cafde39ae6036579ca1b8fa924a9999

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