A professional tool that converts code repositories into a single file with code, dependencies, and structure
Project description
Repo Ingestor
A professional tool that converts code repositories into a single file containing all code, dependencies, file names, and their interconnections. Designed to help developers document and analyze codebases, understand dependencies, and prepare repositories for use with Large Language Models (LLMs).
🚀 Features
- Multi-language Support - Analyze Python, C#, and React projects
- Comprehensive Analysis - Extract dependencies, file structures, and metadata
- Function Call Graph - Visualize function relationships and identify key entry points
- LLM Token Estimation - Calculate token counts for different AI model context windows
- Multiple Output Formats - Export as Markdown, JSON, or plain text
- Performance Optimized - Smart file filtering and size limiting
- Customizable - Extensive pattern matching for file inclusion/exclusion
📋 Installation
# Clone the repository
git clone https://github.com/yourusername/repo-ingestor.git
cd repo-ingestor
# Install the package
pip install -e .
# Or install directly from PyPI
pip install repo-ingestor
🔍 Usage
Basic Usage
# Analyze the current directory
repo-ingestor
# Analyze a specific repository
repo-ingestor /path/to/repository
Output Options
# Change output format (markdown, json (summary only), text)
repo-ingestor --format text
# Specify custom output file
repo-ingestor --output repo-analysis.md
Analysis Options
# Set maximum file size to include (in KB)
repo-ingestor --max-file-size 2048
# Limit directory depth for large repositories
repo-ingestor --depth 3
# Fast token estimation only (skips dependency and function analysis)
repo-ingestor --token-estimate-only
File Selection
# Keep comments in the output
repo-ingestor --keep-comments
# Exclude test files and directories
repo-ingestor --no-tests
# Exclude specific file patterns
repo-ingestor --exclude "*.log" --exclude "temp/*"
Other Options
# Use minimal output mode (less verbose)
repo-ingestor --minimal
# Get full help
repo-ingestor --help
📊 Output Examples
Token Information
Token Count Information:
- Total Estimated Tokens: 14,943
- Structure Tokens: 472
Top Files by Token Count:
| File | Tokens |
| -------------------------------- | ------ |
| repo_ingestor\formatters.py | 2,413 |
| repo_ingestor\cli.py | 2,245 |
| repo_ingestor\core.py | 1,607 |
Function Call Graph
Function Call Graph:
- Total Functions: 55
Most Called Functions:
| Function | Called By |
| ------------------------- | -------------- |
| get_file_content | 2 other functions |
| build_call_graph_from_files | 1 other functions |
Directory Structure
- 📄 README.md
- 📁 **repo_ingestor/**
- 📄 __init__.py
- 📄 __main__.py
- 📄 cli.py
- 📄 config.py
...
🔧 Supported Languages
Python
- Analyzes
.pyfiles, requirements, and configuration files - Detects imports, packages, and entry points
- Builds detailed function call graphs
C#
- Analyzes
.cs,.csproj,.slnfiles, and NuGet packages - Detects namespace imports and project references
- Extracts target framework information
React
- Analyzes
.jsx,.tsx,.js,.tsfiles and package dependencies - Parses package.json for dependencies and scripts
- Identifies component imports and exports
🏗️ Architecture
Repo Ingestor is designed with a modular architecture:
- Core Module: Central orchestration of the analysis process
- Language Handlers: Specialized modules for each supported language
- Formatters: Output generation in various formats
- Analyzers: Function call graph and token estimation
- Utilities: File handling, pattern matching, and comment removal
📝 Configuration
The tool provides extensive configuration options:
- Common include/exclude patterns for repository scanning
- Language-specific file patterns
- File size limits and directory depth limits
- Comment removal options
- Performance optimization settings
🧰 Requirements
- Python 3.7 or higher
- click>=8.0.0
- rich>=10.0.0
- tqdm>=4.62.0
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
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
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 repo_ingestor-0.1.0.tar.gz.
File metadata
- Download URL: repo_ingestor-0.1.0.tar.gz
- Upload date:
- Size: 33.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b79a0fc841a2e1cc97ecbcf98a82c2fcc0777bd2b43b81a58e4e1387415660b2
|
|
| MD5 |
f53577d8925f6a16f8c24b44a7cdeaee
|
|
| BLAKE2b-256 |
4ba99d9e3bc2a24b1a3eafad958833877bab8257c1e8f5884a27bc6c1245fafb
|
File details
Details for the file repo_ingestor-0.1.0-py3-none-any.whl.
File metadata
- Download URL: repo_ingestor-0.1.0-py3-none-any.whl
- Upload date:
- Size: 42.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f21aa757fe9e2242015134c6b07d0c864c361f1e16b1429c8ccba31f280f78d0
|
|
| MD5 |
b46f47dd96ffb71aa30de817ce62fdd2
|
|
| BLAKE2b-256 |
3f7dc116a18d0320b15151662240f93c438d36d66acb7823f4c68ec5ee534b5f
|