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

Uploaded Python 3

File details

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

File metadata

  • Download URL: readmebro-0.1.2.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-0.1.2.tar.gz
Algorithm Hash digest
SHA256 32a244c3748c1c76c4fd9414c81fc9349728888006208b287b20f390fa541dcf
MD5 6653ce3d478e09d1ec5723fd63a84656
BLAKE2b-256 7b2228247c0b299ffe052e3a0c0a254a6477640f68959b9b53a0c8c11af06530

See more details on using hashes here.

File details

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

File metadata

  • Download URL: readmebro-0.1.2-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-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 948aa387ad86ff15d030f76484a74ce4eea03186ecbe839a9fe0b3a1667c31a3
MD5 73f60f1a88d7afd086c1e926b9fca7ee
BLAKE2b-256 f7e196ac787ad3e3d1fc96ceabb7e8c7fdc4d538b1ca0bb27734735a7814e498

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