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

# 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.3.tar.gz (38.2 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.3-py3-none-any.whl (48.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: repo_ingestor-0.1.3.tar.gz
  • Upload date:
  • Size: 38.2 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.3.tar.gz
Algorithm Hash digest
SHA256 e7e37e0363a7f2115cbab320f3edb56bbd4ac6bade65a0f9f0aefbb45242a549
MD5 522a934f0b1f3d74b71ef3b6d2187787
BLAKE2b-256 088a63f28866a4902a012d94a606c2a5c18b72f08791a93f5fe7737d06f01e40

See more details on using hashes here.

Provenance

The following attestation bundles were made for repo_ingestor-0.1.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: repo_ingestor-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 48.6 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 75cf20a0f6e20ecfaefa55ec91868f095ae4a3b8b23e179a18cb8814babbe624
MD5 974ff569a0e392d102ab9274fff43fdc
BLAKE2b-256 d3d4978974873728198e0f481bac4e66a35915e19f43e6468ce5fa9c965ed4f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for repo_ingestor-0.1.3-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