Skip to main content

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

Project description

Github Scrape Project

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 Project 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-project/
โ”œโ”€โ”€ 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-project

# Using pip
pip install github-scrape-project

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-project/config.toml
Windows %APPDATA%\github-scrape-project\config.toml

Available Settings

[github]
token = "ghp_xxxxxxxxxxxxxxxxxxxx"

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

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.2.tar.gz (33.4 kB view details)

Uploaded Source

Built Distribution

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

github_scrape_project-0.1.2-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: github_scrape_project-0.1.2.tar.gz
  • Upload date:
  • Size: 33.4 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.2.tar.gz
Algorithm Hash digest
SHA256 d69385cd18e326706fa56be4006a6c5037fc741531d7c1228474a07fa7cbc112
MD5 26553aa66c9fb718fe03bc3131c6aae1
BLAKE2b-256 08d4012720aed2a08af4a0395d0340f4f70d49e2b45fc36b7ff086ce4bb8f151

See more details on using hashes here.

File details

Details for the file github_scrape_project-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for github_scrape_project-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8d31f5abd7cfb309c5626bbf480c018593e8c9e2634cab994fe0c0c72bbc332e
MD5 95c79675e58da74535261d947f386b53
BLAKE2b-256 348c2fa52fb387c07bf94c0919abd74a5e01b5f910dbecc1ea8285f9442606d9

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