Download any file or folder from any GitHub repo by branch, tag, or commit with glob pattern filtering.
Project description
Forklet
Download any file or folder from any GitHub repo by branch, tag, or commit with glob pattern filtering.
Features
- ✅ Download entire repositories or specific files/folders
- ✅ Support for branches, tags, and specific commits
- ✅ Advanced filtering with glob patterns
- ✅ Rate limiting and intelligent retry mechanisms
- ✅ Concurrent downloads for better performance
- ✅ Both CLI and Python API interfaces
- ✅ Comprehensive error handling and logging
- ✅ Cache support for repeated downloads
Installation
pip install forklet
Or from source
git clone https://github.com/AllDotPy/Forklet.git
cd forklet
pip install -e .
CLI Usage
# Download entire repository
forklet download octocat/hello-world ./downloads
# Download specific branch
forklet download octocat/hello-world ./downloads --ref develop
# Download with filtering
forklet download octocat/hello-world ./downloads \
--include "*.py" \
--exclude "test_*" \
--max-size 1000000
# Download with authentication
forklet download private-owner/private-repo ./downloads --token YOUR_GITHUB_TOKEN
# Show repository information
forklet info octocat/hello-world
Python API Usage
from forklet import GitHubDownloader
from pathlib import Path
# Initialize downloader
downloader = GitHubDownloader(auth_token="your_github_token")
# Download entire repository
result = downloader.download(
owner="octocat",
repo="hello-world",
destination=Path("./downloads"),
ref="main",
include_patterns=["*.py", "*.md"],
exclude_patterns=["test_*"]
)
print(f"Downloaded {len(result.downloaded_files)} files")
print(f"Total size: {result.progress.downloaded_bytes} bytes")
# Download specific directory
result = downloader.download_directory(
owner="octocat",
repo="hello-world",
directory_path="src",
destination=Path("./src-only")
)
# Download specific file
result = downloader.download_file(
owner="octocat",
repo="hello-world",
file_path="README.md",
destination=Path("./readme.md")
)
Configuration
Set environment variables for configuration:
export GITHUB_TOKEN=your_github_token
export FORKLET_CONCURRENT_DOWNLOADS=10
export FORKLET_CACHE_ENABLED=true
export FORKLET_LOG_LEVEL=DEBUG
Or use a .env file:
GITHUB_TOKEN=your_github_token
FORKLET_CONCURRENT_DOWNLOADS=10
FORKLET_CACHE_ENABLED=true
FORKLET_LOG_LEVEL=DEBUG
🤝 Contributing
We welcome contributions from the community! Please see the CONTRIBUTING.md guide for more information.
License 📜
Apache-2.0 license © 2025 AllDotPy
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file forklet-0.1.0.tar.gz.
File metadata
- Download URL: forklet-0.1.0.tar.gz
- Upload date:
- Size: 58.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2e433fd3f5618c43dc0cdc3b238eb9afca6066a7d66af4a57682ab0743cfee2
|
|
| MD5 |
966cf8bea2629e9af396e18b217460f3
|
|
| BLAKE2b-256 |
a68abdb1337f4d15d698588dd33b3d5ced0e99cf58b110e0bb37bad0788e33fe
|
File details
Details for the file forklet-0.1.0-py3-none-any.whl.
File metadata
- Download URL: forklet-0.1.0-py3-none-any.whl
- Upload date:
- Size: 72.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96695e6f76e613f2db37b3c608b1bf0aaeaf73c6d50e7108c3f1300a1c1d5caa
|
|
| MD5 |
fc200d2447c87dd1bc1ce753cda522b6
|
|
| BLAKE2b-256 |
e02ac6c9ceccbee9113fcf4d3b2da3f229e6d0e9262725cefb734af24d5c2446
|