Skip to main content

Browse, search, and download files from GitHub repos in your terminal.

Project description

Github Scrape

PyPI version Python version Tests License

โšก Browse, search & download files from GitHub repos without cloning

A fast, beautiful TUI for cherry-picking exactly what you need from any repository

Demo


๐Ÿ“š Table of Contents


๐Ÿ“Œ Overview

Github Scrape is a terminal-based file browser that lets you:

  • Browse any public or private GitHub repository interactively
  • Fuzzy search through thousands of files instantly
  • Download only what you need โ€” no more git clone + rm -rf
  • Navigate with a beautiful TUI powered by Textual

๐Ÿ’ก Built with Python 3.12+, powered by asyncio and designed for speed


โœจ Features

Feature Description
๐Ÿ” Fuzzy Search Find files instantly with rapidfuzz matching
๐Ÿ“Š File Preview View file contents before downloading
๐Ÿ“ฆ Batch Download Select multiple files & folders, download in parallel
๐Ÿ” Private Repo Support Works with your GitHub token
๐Ÿ’พ LFS Detection Warns about Git LFS files
๐ŸŽจ Dual Themes Toggle between emoji ๐Ÿ“ and ASCII [D] icons
๐Ÿ“‚ Smart Paths Creates directories matching repository structure
โšก Async I/O Concurrent downloads with semaphore control

๐Ÿ—๏ธ Architecture

github-scrape/
โ”œโ”€โ”€ src/github_scrape/
โ”‚   โ”œโ”€โ”€ __init__.py      # Package entry point
โ”‚   โ”œโ”€โ”€ api.py           # GitHub API client (httpx + asyncio)
โ”‚   โ”œโ”€โ”€ cli.py           # Typer CLI interface
โ”‚   โ”œโ”€โ”€ config.py        # User settings (TOML)
โ”‚   โ”œโ”€โ”€ downloader.py    # Async file downloads
โ”‚   โ”œโ”€โ”€ tui.py           # Textual TUI screens
โ”‚   โ””โ”€โ”€ utils.py         # URL parsing & sanitization
โ”œโ”€โ”€ tests/               # 110+ tests (pytest)
โ””โ”€โ”€ .github/workflows/   # CI/CD pipeline

Tech Stack:

Component Technology
CLI typer with Rich formatting
TUI textual reactive framework
HTTP httpx async client
Testing pytest + respx + pytest-asyncio

๐Ÿš€ Installation

Prerequisites

  • Python 3.12 or higher
  • pip or pipx

Quick Install

# Using pipx (recommended)
pipx install github-scrape

# Using pip
pip install github-scrape

Development Setup

1๏ธโƒฃ Clone repository

git clone https://github.com/Vamsiindugu/Github-Scrape.git
cd Github-Scrape

2๏ธโƒฃ Create virtual environment

python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate

3๏ธโƒฃ Install in editable mode

pip install -e ".[dev]"

4๏ธโƒฃ Run tests

pytest tests/ -v

๐Ÿ“– Usage

๐ŸŽฌ Interactive Mode

Launch the TUI with no arguments:

github-scrape

Then:

1๏ธโƒฃ Enter a URL or shorthand (owner/repo)

2๏ธโƒฃ Press Tab to auto-fill https://github.com/

3๏ธโƒฃ Browse with arrow keys, toggle selection with Space

4๏ธโƒฃ Press d to download

โšก Direct Mode

# Browse specific repo
github-scrape https://github.com/python/cpython

# Use shorthand
github-scrape python/cpython

# With options
github-scrape python/cpython --token YOUR_TOKEN --cwd --no-folder

๐Ÿ”ง Command Reference

Command Description
github-scrape Launch interactive TUI
github-scrape <url> Browse specific repository
github-scrape config set token <TOKEN> Save GitHub token
github-scrape config set path <PATH> Set download directory
github-scrape config list Show current settings
github-scrape config unset token Remove saved token

โŒจ๏ธ Keyboard Shortcuts

Navigation

Key Action
โ†‘/โ†“ or j/k Move cursor up/down
Enter or l Open folder / file
h or Backspace Go to parent folder
g / Home Jump to first item
G / End Jump to last item

Selection

Key Action
Space Toggle file selection
a Select all visible files
u Unselect all

Search

Key Action
/ Focus search bar
Escape Clear search / exit search
Ctrl+U Clear search input

Actions

Key Action
d Download selected files
i Toggle emoji โ†” ASCII icons
o Open download folder
q Quit
Ctrl+C Force quit

โš™๏ธ Configuration

Config File Location

OS Path
Linux/macOS ~/.config/github-scrape/config.toml
Windows %APPDATA%\github-scrape\config.toml

Available Settings

[github]
token = "ghp_xxxxxxxxxxxxxxxxxxxx"

[download]
default_path = "/home/user/Downloads/github-scrape"

Getting a GitHub Token

1๏ธโƒฃ Go to Settings โ†’ Developer settings โ†’ Personal access tokens

2๏ธโƒฃ Generate a new token with repo scope

3๏ธโƒฃ Save it: github-scrape config set token YOUR_TOKEN


๐Ÿค Contributing

Contributions are welcome! Please follow these steps:

1๏ธโƒฃ Fork the repository

2๏ธโƒฃ Clone your fork: git clone https://github.com/YOUR_USERNAME/Github-Scrape.git

3๏ธโƒฃ Create a feature branch: git checkout -b feature/amazing-feature

4๏ธโƒฃ Make your changes

5๏ธโƒฃ Run quality checks:

# Linting
ruff check src/github_scrape tests/

# Type checking
mypy src/github_scrape

# Tests
pytest tests/ -v

6๏ธโƒฃ Commit with clear messages: git commit -m "feat: add amazing feature"

7๏ธโƒฃ Push to your fork: git push origin feature/amazing-feature

8๏ธโƒฃ Open a Pull Request

Development Guidelines

Quality Gate Command Required
Linting ruff check . โœ…
Type checking mypy src/github_scrape โœ…
Tests pytest tests/ โœ…
Coverage >80% โœ…

๐Ÿ“Š Testing

# Run all tests
pytest tests/ -v

# Run with coverage
pytest tests/ --cov=github_scrape --cov-report=html

# Run specific test file
pytest tests/test_tui.py -v

Current Coverage: 110+ tests passing, 8 TUI integration tests skipped.


๐Ÿ™ Acknowledgments

  • Textual โ€” The incredible TUI framework
  • Typer โ€” Beautiful CLI interfaces
  • Rich โ€” Terminal formatting
  • ghgrab โ€” Original inspiration

๐Ÿ“„ License

Distributed under the MIT License. See LICENSE for details.


Crafted with ๐Ÿ’™ by Vamsi Indugu

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

github_scrape_project-0.1.1.tar.gz (58.2 kB view details)

Uploaded Source

File details

Details for the file github_scrape_project-0.1.1.tar.gz.

File metadata

  • Download URL: github_scrape_project-0.1.1.tar.gz
  • Upload date:
  • Size: 58.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for github_scrape_project-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d9d1b436e2f31e461f6165c984be92618e339461fc5aca90ab3ac592712a24ca
MD5 1cc72ceaeec066519e7342bab19096b9
BLAKE2b-256 4449271109dd102fe04ef19e433b72e899f93f8c663eb2860e1558a446294c5c

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