Skip to main content

A professional tool that converts code repositories into a single file with code, dependencies, and structure

Project description

Repo Ingestor

License: MIT Python 3.7+

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 .py files, requirements, and configuration files
  • Detects imports, packages, and entry points
  • Builds detailed function call graphs

C#

  • Analyzes .cs, .csproj, .sln files, and NuGet packages
  • Detects namespace imports and project references
  • Extracts target framework information

React

  • Analyzes .jsx, .tsx, .js, .ts files 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

repo_ingestor-0.1.1.tar.gz (32.5 kB view details)

Uploaded Source

Built Distribution

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

repo_ingestor-0.1.1-py3-none-any.whl (41.8 kB view details)

Uploaded Python 3

File details

Details for the file repo_ingestor-0.1.1.tar.gz.

File metadata

  • Download URL: repo_ingestor-0.1.1.tar.gz
  • Upload date:
  • Size: 32.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for repo_ingestor-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2819dda3780f1d9c06e43069906608dd2950e7acee0b2cd8a7bb185eac452520
MD5 e1ab51b448b894e04f8a51493bbcc72f
BLAKE2b-256 f71f3e9c34f0664330ef52e3702fbed9e5a439b24caa43a7d90ff6c438670b5a

See more details on using hashes here.

Provenance

The following attestation bundles were made for repo_ingestor-0.1.1.tar.gz:

Publisher: python-publish.yml on aviv943/repo-ingestor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file repo_ingestor-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: repo_ingestor-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 41.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for repo_ingestor-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 137926998b4a6e76fddd6cf439fb63c81105b9bf2564025dd5133f13ff1e1c9f
MD5 e0d414df4162af92a707f4303916de96
BLAKE2b-256 39bb68f87ad0857e18290ea99e36ad973f909435df31fcfac9c7994b00fa9872

See more details on using hashes here.

Provenance

The following attestation bundles were made for repo_ingestor-0.1.1-py3-none-any.whl:

Publisher: python-publish.yml on aviv943/repo-ingestor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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