Skip to main content

Just turns your repo into a text file innit...🦖

Project description

🦖 Reposaurus

A powerful tool for transforming repositories into comprehensive text files. Perfect for documentation, AI tool integration, and code review preparation.

Overview

Reposaurus is designed to capture your entire codebase in a single, well-organized text file. It features a dual pattern matching system: simple and efficient default exclusions for common cases, plus advanced gitignore-style pattern matching when you need more control. Whether you're preparing code for AI analysis, documenting your project, or archiving project states, Reposaurus helps you focus on what matters by excluding unnecessary files.

Features

  • 📁 Smart Directory Structure Visualization
  • 📝 Complete File Content Extraction
  • 🧠 Dual Pattern Matching System:
    • Simple, efficient matching for common exclusions
    • Advanced gitignore-style patterns when you need them
  • 🦖 Compatible with Any Git Repository
  • ⚡ Fast and Efficient Processing
  • 🛠️ Simple Command-Line Interface

Installation

Install Reposaurus using pip:

pip3 install reposaurus

On macOS, you might need to add Python's bin directory to your PATH:

echo 'export PATH="$HOME/Library/Python/3.9/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

Basic Usage

Reposaurus offers straightforward command-line operation:

# Process current directory with default exclusions
reposaurus

# Process a specific directory
reposaurus /path/to/repository

# Use custom exclusion patterns
reposaurus --exclude-file my_patterns.txt

This creates a repository_contents.txt file in your target directory containing:

  • A visual representation of your directory structure
  • The complete contents of all included text files
  • Automatic filtering of binary files and development artifacts

Pattern Matching System

Reposaurus employs a dual approach to file exclusions:

Default Pattern Matching

By default, Reposaurus uses a simple, efficient pattern matching system that automatically excludes:

  • Development Directories:

    • Version control (.git, .svn)
    • IDE configurations (.vs, .idea, .vscode)
    • Python artifacts (__pycache__, .egg-info)
    • Virtual environments (venv, .env)
  • Build and Dependencies:

    • Build outputs (bin, obj, build, dist)
    • Dependencies (node_modules, packages)
    • Cache directories (.cache, __pycache__)
  • System and Binary Files:

    • System files (.DS_Store, Thumbs.db)
    • Compiled files (.pyc, .exe, .dll)
    • Archives (.zip, .tar, .gz)
    • Media files (.jpg, .png, .mp3)
    • Logs and databases (.log, .sqlite)

Advanced Pattern Matching

When you need more control, you can provide a custom exclusion file using familiar gitignore syntax:

reposaurus --exclude-file my_patterns.txt

Your exclusion file can use the full .gitignore syntax:

# Ignore all .txt files
*.txt

# But keep important.txt
!important.txt

# Ignore temp folders anywhere
**/temp/

# Ignore specific directories
build/
node_modules/

# Complex patterns
docs/**/*.md
!docs/README.md

Pattern matching features include:

  • Basic wildcards (*.txt, project-*/)
  • Directory wildcards (**/temp matches temp anywhere)
  • Negation patterns (!important.txt)
  • Directory-specific matching (docs/*.md)
  • Comments for pattern documentation

Output Format

The generated repository_contents.txt file is structured for clarity:

Directory structure:
└── repository/
    ├── src/
    │   ├── main.py
    │   └── utils.py
    ├── docs/
    │   └── README.md
    └── config.json

================================================
File: /src/main.py
================================================
[File contents here]

================================================
File: /src/utils.py
================================================
[File contents here]

Error Handling

Reposaurus handles various edge cases gracefully:

  • Binary files are automatically skipped
  • Files with encoding issues are noted but don't halt processing
  • Invalid patterns in exclusion files are reported with helpful messages
  • Missing directories or permissions issues are clearly reported

Contributing

Contributions are welcome! Feel free to:

  • Report bugs
  • Suggest features
  • Submit pull requests
  • Improve documentation

License

MIT License - See LICENSE file for details

Authors

  • Andy Thomas - Initial work

Acknowledgments

Built with love and a touch of prehistoric magic 🦖✨

For more information, visit our documentation or raise an issue on GitHub.

Version History

  • 0.1.4 - Added dual pattern matching system with gitignore support
  • 0.1.3 - Initial public release

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

reposaurus-0.1.5.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

reposaurus-0.1.5-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file reposaurus-0.1.5.tar.gz.

File metadata

  • Download URL: reposaurus-0.1.5.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.6

File hashes

Hashes for reposaurus-0.1.5.tar.gz
Algorithm Hash digest
SHA256 5e5c5b018a135d0ee6ecd9430288eaf1e362e8a43663e044858d553fdfd085c3
MD5 ed87ab2b9c788ba557e713e90d31edc5
BLAKE2b-256 68c7c9d967959fea47195e3f483bc2fc836eb4dc442fd1c604fae6fb93920d4a

See more details on using hashes here.

File details

Details for the file reposaurus-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: reposaurus-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.6

File hashes

Hashes for reposaurus-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 bc620f2c127191381984c9be515d8424593333bb9f6d4ac9b3fee82831b7e4e5
MD5 edd7da38e4afe9ec6d318d5f5a409b4b
BLAKE2b-256 fd8785af521b489426b1dab7153fb5cc28dc41fd62d735c6c942502b292581f2

See more details on using hashes here.

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