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.2.0.tar.gz (19.8 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.2.0-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: github_scrape_project-0.2.0.tar.gz
  • Upload date:
  • Size: 19.8 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.2.0.tar.gz
Algorithm Hash digest
SHA256 cba58656b601e032287470eabc2c1ee779858a2dcd377d6bab4a7a6d9b5c4ef7
MD5 02a2a05f7922a124a83a937d6c39c429
BLAKE2b-256 e600649a4afdbf449f4be90ced98e31b6e949a2ae353f0beff9994373bdb524d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for github_scrape_project-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ebbe4d5cb046ebbe270e157988ba58d5841de442107629c42611cc2893978dd
MD5 fa2e305aeca8c3f374b5954dea31efbc
BLAKE2b-256 d8ad84a454599db3cce45ffb24dd8dbe8df24368156b4212b3f432716a1ea3c1

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