TLDR - Function Signature Extractor
TLDR is a Python tool that extracts function signatures from large codebases and generates concise summaries. It's particularly useful for providing context to Large Language Models (LLMs) when dealing with codebases that exceed their context window limits.
Features
- Multi-language Support: Supports 40+ programming languages via Pygments lexer integration
- Signature Extraction: Extracts function, class, and method signatures from code files
- JSON Output: Produces structured JSON output for easy integration with other tools
- Recursive Processing: Can process entire directory trees recursively
- Atomic File Writing: Ensures data integrity with atomic file operations
- (Optional) AI-Powered File Summaries: Generates file summaries using LLM providers (Claude, OpenAI, Grok)
Supported Languages
JavaScript/TypeScript, Python, Java, C/C++, C#, PHP, Ruby, Go, Rust, Swift, Scala, Kotlin, and many more.
Installation
# Clone the repository
git clone https://github.com/csimoes1/tldr-code.git
cd tldr-code
# Create a virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
# Install dependencies
pip install -r requirements.txt
Usage
# Show usage help message
python tldr_code.py -h
# Process a local directory tree to generate a tldr summary file
python tldr_code.py /path/to/directory
# Example: Process a GitHub repository and create a tldr summary file (example here is the Python fastapi project)
python tldr_code.py https://github.com/fastapi/fastapi
# Example: Process a GitHub repository and store the downloaded files and the tldr summary file in a specific directory
python tldr_code.py https://github.com/fastapi/fastapi /Users/csimoes/repos/fastapi
Command Line Options
input (GitHub URL | /path/to/directory): Path to the repo/directory to scan (required)output_filename: Output filename (optional, defaults totldr.json)
Output Format
TLDR generates JSON files with the following structure:
{
"directory_path": "/path/to/directory",
"last_updated": "2025-06-16T10:30:00Z",
"files": [
{
"file_path": "/path/to/file.py",
"last_scanned": "2025-06-16T10:30:00Z",
"signatures": [
"class MyClass(BaseClass)",
"def __init__(self, param1, param2)",
"def process_data(self, data: List[str]) -> Dict[str, Any]"
],
"summary": "This file implements data processing functionality..."
}
]
}
Use Cases
- LLM Context Preparation: Quickly generate summaries of large codebases for LLM analysis
- Code Documentation: Automatically extract API signatures for documentation
- Codebase Analysis: Get an overview of code structure and functionality
- Code Review Assistance: Understand code changes and their impact
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
See LICENSE file for details.
Metadata
Release files for tldr-code 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tldr_code-0.1.2.tar.gz | 23.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tldr_code-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 44.4 kB
Release files / tldr_code-0.1.2.tar.gz
| Download URL | tldr_code-0.1.2.tar.gz |
|---|---|
| Size | 23.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c8e4fb732bdbc5cf7908b7d5dd2e1fc2d87a0484c5c8b57d4073d959582c1c50
|
|
BLAKE2b-256 checksum How to use checksums |
c2038bd165c5dfca17c1de290677deb40d7fb0f7fe78d66d816b744e2747a117
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Release files / tldr_code-0.1.2-py3-none-any.whl
| Download URL | tldr_code-0.1.2-py3-none-any.whl |
|---|---|
| Size | 21.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1855168051e32deed587c190ec9c08af763aa2baa660144d588920de6fec11f6
|
|
BLAKE2b-256 checksum How to use checksums |
a0d32de9427f9cc64895681981ade56fabbd313a35df8cb7a078075c56fd132f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|