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.2.tar.gz (32.4 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.2-py3-none-any.whl (41.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: repo_ingestor-0.1.2.tar.gz
  • Upload date:
  • Size: 32.4 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.2.tar.gz
Algorithm Hash digest
SHA256 20a0bc0561fd620e67dd27331c6dd187a16e47d9fdf121e2eb01c4cd25a907c9
MD5 31502bb50891cb6d201da834e46cb8ec
BLAKE2b-256 e38c3756915a345704591a48d3525e831ee47b50b089b67522f3a076dc0254e0

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: repo_ingestor-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 41.7 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 be461e7a7f3b804f1f39774bb0fb61c99287d1e5e0a3ea81923fe6011dc2e322
MD5 42953d4ea2862bd7cfa38e4edd8b303c
BLAKE2b-256 ff9e1c0d3fab0532a9c73964ea6a0fc9f77d21c23c2177b18190d35a08a96203

See more details on using hashes here.

Provenance

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