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/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

📂 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-1.0.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

readmebro-1.0.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for readmebro-1.0.0.tar.gz
Algorithm Hash digest
SHA256 59609fa32c64a034cb2c40c0a2ef3a5ea4dd399d81f1a44f6fd52e53a142c61d
MD5 0de48f10dd1b5f709e15d306f6dba70f
BLAKE2b-256 daf5b48067a61ca8ba1b9935b3e72dc6e3e507245043e81a98ba9036f0180ee2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: readmebro-1.0.0-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.12.9

File hashes

Hashes for readmebro-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3ecbdf8937115d0314ab1696713760b98b731f633157d1ecec9174bc30210270
MD5 947eea2a0240204c972d56a70fa07cd0
BLAKE2b-256 38c89d0ee16d0413c3159a5150cb5fada30d9b571ccec8db9d5bb622306d6a00

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