Generate LLM-friendly summaries of Python and Go codebases
Project description
LLM Project Summarizer
LLM Project Summarizer is a specialized command-line tool that transforms Python and Go codebases into concise, structured summaries optimized for Large Language Models. When working with LLMs like ChatGPT or Claude, sending entire codebases is often impractical due to context limitations. This tool solves that problem by generating intelligent summaries that capture the essential architecture, relationships, and patterns in your code while excluding implementation details.
The tool understands language-specific patterns โ in Go, it recognizes packages, interfaces, and implementations; in Python, it comprehends modules, class hierarchies, and type annotations. The output is formatted in Markdown with Mermaid diagrams, making it ideal for LLM consumption and human readability.
Table of Contents
Features
โจ Smart Code Analysis
- Understands Python and Go code patterns
- Extracts classes, functions, interfaces and their relationships
- Identifies key architectural patterns
๐ Rich Visualization
- Generates Mermaid diagrams showing dependency relationships
- Creates hierarchical package/module summaries
- Shows inheritance and implementation relationships
๐ง Flexible Configuration
- Exclude patterns and directories
- Customize output format and detail level
- YAML configuration support
Installation
Option 1: Install from PyPI
pip install llm-project-summarizer
Option 2: Install from GitHub
pip install git+https://github.com/MuhammadYossry/llm-project-summarizer.git
Option 3: Development Installation
# Clone the repository
git clone https://github.com/MuhammadYossry/llm-project-summarizer
cd llm-project-summarizer
# Install with poetry (recommended for development)
poetry install
# Or install with pip in editable mode
pip install -e .
Usage
Basic Usage
# Using pip installed version
llm-project-summarizer /path/to/project
# Custom output file
llm-project-summarizer /path/to/project -o custom_summary.md
# Exclude patterns
llm-project-summarizer /path/to/project --exclude "vendor/*" --exclude "*.test.go"
Using Poetry
# Install and run using poetry
poetry install
poetry run llm-project-summarizer/path/to/project
# Run with options
poetry run llm-project-summarizer /path/to/project -o summary.md --exclude "vendor/*"
With Configuration File
Create .summarizer.yaml:
exclude:
- "vendor/*"
- "**/*_test.go"
- "**/__pycache__"
output: "project_summary.md"
Use the config:
llm-project-summarizer /path/to/project --config .summarizer.yaml
Command Line Options
llm-project-summarizer--help
Options:
--output, -o PATH Output file path [default: project_summary.md]
--exclude, -e TEXT Exclusion patterns (can be used multiple times)
--config, -c PATH Path to config file
--help Show this message and exit
How It Works
The tool employs language-specific parsers to analyze source code. For Go, it uses pattern matching to identify packages, interfaces, and implementations. For Python, it utilizes the Abstract Syntax Tree (AST) to extract classes, functions, and their relationships. The parsed information is then organized into a hierarchical structure optimized for LLM understanding.
Examples
Input project structure:
myproject/
โโโ cmd/
โ โโโ server/
โ โโโ main.go
โโโ internal/
โ โโโ api/
โ โ โโโ handlers.go
โ โโโ service/
โ โโโ users.go
Project Generated Summary
Project Architecture
This is a Go project with the following structure:
Entry Points
- cmd/server/main.go
Package Structure
api
Key Interfaces:
- Handler: HTTP request handler interface
- Service: Business logic interface
Dependencies
graph TD
api-->service
main-->api
Here's an example analyzing a mixed Python/Go microservice:
Input project structure:
acme-service/
โโโ api/
โ โโโ handlers/
โ โ โโโ user_handler.go
โ โ โโโ auth_handler.go
โ โโโ middleware/
โ โโโ jwt.go
โโโ services/
โ โโโ user_service.py
โ โโโ auth_service.py
โโโ models/
โโโ user.go
โโโ schema.py
Project Generated Summary
Project Architecture
This is a mixed-language microservice using Go for API handlers and Python for business logic.
Package Structure
api/handlers/user_handler.go
Package: handlers
Symbols: interface: UserHandler Methods: - GetUser(id string) (*User, error) - CreateUser(user *User) error - UpdateUser(id string, user *User) error
struct: userHandler Implements: UserHandler Dependencies: UserService
services/user_service.py
Package: services
Symbols: class: UserService Methods: - async def get_user(self, id: str) -> User - async def create_user(self, user: User) -> User - async def update_user(self, id: str, user: User) -> User
Dependencies:
- models.User
- database.Repository
Architecture Diagram
graph TD
subgraph Go API Layer
UH[UserHandler]
AH[AuthHandler]
JWT[JWT Middleware]
end
subgraph Python Services
US[UserService]
AS[AuthService]
DB[(Database)]
end
UH --> US
AH --> AS
US --> DB
AS --> DB
JWT --> AS
Contributing
We welcome contributions. To get started:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for any new functionality
- Submit a pull request
Testing
Run the test suite using Poetry:
# Run all tests
poetry run pytest
# Run tests with coverage report
poetry run pytest --cov=llm_project_summarizer tests/ --cov-report=term-missing
# Run specific test files
poetry run pytest tests/test_parsers.py
License
This project is licensed under the MIT License
Project details
Release history Release notifications | RSS feed
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 llm_project_summarizer-0.0.3.tar.gz.
File metadata
- Download URL: llm_project_summarizer-0.0.3.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cffb7031c8f54eb26781c7bfafb96d980a36e75b4d8adca6120a664a07d10ad
|
|
| MD5 |
bc3e743e60f4f99b777c382a1df3759c
|
|
| BLAKE2b-256 |
e9733551dea029fa8cafb26441ed315d7d13c876859fb014a70423dcc586f970
|
Provenance
The following attestation bundles were made for llm_project_summarizer-0.0.3.tar.gz:
Publisher:
ci.yml on MuhammadYossry/llm-project-summarizer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_project_summarizer-0.0.3.tar.gz -
Subject digest:
8cffb7031c8f54eb26781c7bfafb96d980a36e75b4d8adca6120a664a07d10ad - Sigstore transparency entry: 157361988
- Sigstore integration time:
-
Permalink:
MuhammadYossry/llm-project-summarizer@96515192d3287cb94e2708ac6194079f54eed92a -
Branch / Tag:
refs/tags/v0.0.3 - Owner: https://github.com/MuhammadYossry
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@96515192d3287cb94e2708ac6194079f54eed92a -
Trigger Event:
push
-
Statement type:
File details
Details for the file llm_project_summarizer-0.0.3-py3-none-any.whl.
File metadata
- Download URL: llm_project_summarizer-0.0.3-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bbbe3481dbd73bdd5e8fbc3e3643817adb7015015d7ebcbe139f7437bd09db3
|
|
| MD5 |
d242017a3b333681db9671b90ae80a70
|
|
| BLAKE2b-256 |
4365833f0179606e7582802f94d818bc49337f017e51854df3ff956e446a737b
|
Provenance
The following attestation bundles were made for llm_project_summarizer-0.0.3-py3-none-any.whl:
Publisher:
ci.yml on MuhammadYossry/llm-project-summarizer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_project_summarizer-0.0.3-py3-none-any.whl -
Subject digest:
9bbbe3481dbd73bdd5e8fbc3e3643817adb7015015d7ebcbe139f7437bd09db3 - Sigstore transparency entry: 157361990
- Sigstore integration time:
-
Permalink:
MuhammadYossry/llm-project-summarizer@96515192d3287cb94e2708ac6194079f54eed92a -
Branch / Tag:
refs/tags/v0.0.3 - Owner: https://github.com/MuhammadYossry
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@96515192d3287cb94e2708ac6194079f54eed92a -
Trigger Event:
push
-
Statement type: