Skip to main content

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 = await 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 = await downloader.download_directory(
    owner="octocat",
    repo="hello-world",
    directory_path="src",
    destination=Path("./src-only")
)

# Download specific file
result = await downloader.download_file(
    owner="octocat",
    repo="hello-world",
    file_path="README.md",
    destination=Path("./readme.md")
)

🤝 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

forklet-0.1.1.tar.gz (62.4 kB view details)

Uploaded Source

Built Distribution

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

forklet-0.1.1-py3-none-any.whl (78.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for forklet-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5cdd7321386c3f3b7cde3793f3fdc3f4884752a2a00d7f1b3ff8f2a0a3600e79
MD5 60c75628dc9f43bca8c2c57fd8394c2d
BLAKE2b-256 b5c38ad1f7f13cdebc9418e415930a5928742ea668144c1bc8e565ff143aba25

See more details on using hashes here.

File details

Details for the file forklet-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: forklet-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 78.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for forklet-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7e883891214f3040683331302193243f56462d5c38d1c1a327c35b31b64bb99c
MD5 00ab2bfdd683cfced1ce273d54591081
BLAKE2b-256 333541370055db9426482cc2abb88c343f2d333c07b514f346a8344e112e789d

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