Skip to main content

RepoSnap

Overview

reposnap is a Python tool designed to generate a Markdown file that documents the structure and contents of a Git project. It provides both a command-line interface (CLI) and a graphical user interface (GUI) for ease of use. This tool is particularly useful for creating a quick overview of a project's file hierarchy, including optional syntax-highlighted code snippets.

Features

  • Command-Line Interface (CLI): Quickly generate documentation from the terminal.
  • Graphical User Interface (GUI): A user-friendly GUI if you want to select files and directories interactively.
  • Syntax Highlighting: Includes syntax highlighting for known file types in the generated Markdown file.
  • Structure Only Option: The --structure-only flag can be used to generate the Markdown file with just the directory structure, omitting the contents of the files.
  • Gitignore Support: Automatically respects .gitignore patterns to exclude files and directories.

Installation

You can install reposnap using pip:

pip install reposnap

Alternatively, you can clone the repository and install the required dependencies:

git clone https://github.com/username/reposnap.git
cd reposnap
pip install -r requirements.txt

Usage

Command-Line Interface

To use reposnap from the command line, run it with the following options:

reposnap [-h] [-o OUTPUT] [--structure-only] [--debug] path
  • path: Path to the Git repository or subdirectory.
  • -h, --help: Show help message and exit.
  • -o, --output: The name of the output Markdown file. Defaults to output.md.
  • --structure-only: Generate a Markdown file that includes only the project structure, without file contents.
  • --debug: Enable debug-level logging.

Examples

  1. Generate a full project structure with file contents:

    reposnap .
    
  2. Generate a project structure only:

    reposnap my_project/ --structure-only
    
  3. Generate a Markdown file excluding certain files and directories:

    reposnap my_project/ -o output.md
    

Graphical User Interface

reposnap also provides a GUI for users who prefer an interactive interface.

To launch the GUI, simply run:

reposnap-gui

Using the GUI

  1. Select Root Directory: When the GUI opens, you can specify the root directory of your Git project. By default, it uses the current directory.

  2. Scan the Project: Click the "Scan" button to analyze the project. The GUI will display the file tree of your project.

  3. Select Files and Directories: Use the checkboxes to select which files and directories you want to include in the Markdown documentation. Toggling a directory checkbox will toggle all its child files and directories.

  4. Generate Markdown: After selecting the desired files, click the "Render" button. The Markdown file will be generated and saved as output.md in the current directory.

  5. Exit: Click the "Exit" button to close the GUI.

Testing

To run the tests, use the following command:

pytest tests/

Ensure that you have the pytest library installed:

pip install pytest

License

This project is licensed under the MIT License.

Acknowledgments

  • GitPython - Used for interacting with Git repositories.
  • pathspec - Used for pattern matching file paths.
  • Urwid - Used for creating the GUI interface.

Metadata

Release files for reposnap 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for reposnap 0.4.0
File Size Uploaded Provenance
reposnap-0.4.0.tar.gz 11.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for reposnap 0.4.0
File Interpreter ABI Platform
reposnap-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.4 kB

Release files / reposnap-0.4.0.tar.gz

Download URL reposnap-0.4.0.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5531f9f8d6a995b963ed9162f16db32a8a229540b0b541fe506ca16c6e798b42
BLAKE2b-256 checksum
How to use checksums
362f64ad3069eb51bdfe1fab9bff875dc2170b9ddf4e738bd28571b88225592e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / reposnap-0.4.0-py3-none-any.whl

Download URL reposnap-0.4.0-py3-none-any.whl
Size 11.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9da896e617c76c5274cb60ca8dd0e770ecad45c3154f3074bd0d8734977a2736
BLAKE2b-256 checksum
How to use checksums
37dff7ba1724dfc9578636c32c5aeb7288c43b7f35a19cb3fddfbfc5725cb996
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Security for reposnap 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page