A tool to serialize repository contents into a single file
Project description
Repo Serializer
A Python utility for serializing local Git repositories into a structured text file, capturing the directory structure (in ASCII format), file names, and contents of source files. Ideal for providing a comprehensive snapshot of a repository for code review, documentation, or interaction with large language models (LLMs).
Installation
# Install from PyPI
pip install repo-serializer
Usage
Command Line
# Basic usage
repo-serializer /path/to/repository
# Specify output file
repo-serializer /path/to/repository -o output.txt
Python API
from repo_serializer import serialize
# Serialize a repository
serialize("/path/to/repository", "output.txt")
Features
- Directory Structure: Clearly visualize repository structure in ASCII format.
- File Filtering: Excludes common binary files, cache directories, hidden files, and irrelevant artifacts to keep outputs concise and focused.
- Smart Content Handling:
- Parses Jupyter notebooks to extract markdown and code cells with sample outputs
- Limits CSV files to first 5 lines
- Truncates large text files after 1000 lines
- Handles non-UTF-8 and binary files gracefully
- Extensive Filtering: Skips common configuration files, build artifacts, test directories, and more.
Example
# Create a serialized snapshot of your project
repo-serializer /Users/example_user/projects/my_repo -o repo_snapshot.txt
Contributing
Pull requests and improvements are welcome! Please ensure your contributions are clearly documented and tested.
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-serializer-0.1.5.tar.gz
(5.4 kB
view details)
Built Distribution
File details
Details for the file repo-serializer-0.1.5.tar.gz
.
File metadata
- Download URL: repo-serializer-0.1.5.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 835580f021fa6d906b270593346ad28d7b88081109daafaf9c369c3361a21d71 |
|
MD5 | e6fe465d0e8d266653dd1d60bf90d145 |
|
BLAKE2b-256 | 67c03bf5fce940bf5c17f36d58d84ff6ad85c26cdbc8040cd294d1e2fd2e1244 |
File details
Details for the file repo_serializer-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: repo_serializer-0.1.5-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a031951aac92d6b3fa863fd4b788eecd3a416453db4470adc1cbdbbdcda1e4d1 |
|
MD5 | 4167a3af6be530fc38b4ba687b906e32 |
|
BLAKE2b-256 | a9d496d6480073eea0756db3ca864309cd5554a88d2cacb38d1912bc5fbac1c7 |