GitHub Release Downloader
![Python versions](https://img.shields.io/pypi/pyversions/github_release_downloader.svg)
Python package to download/filter any release assets from the latest compatible version.
Installation
pip install github-release-downloader
Usage
This tool can be used as library:
from semantic_version import SimpleSpec
from github_release_downloader import check_and_download_updates, GitHubRepo
from pathlib import Path
import re
check_and_download_updates(
GitHubRepo("OwnerName", "RepoName", "OptionallyToken"),
SimpleSpec("~1.1"),
assets_mask=re.compile(".*\\.exe"),
downloads_dir=Path("downloads"),
)
Or either it can be used as cli-tool:
python -m github_release_downloader -u OwnerName -n RepoName -r ~1.1 -m .*\.exe -o .\downloads
Features
- Downloads compatible releases (or latest if no requirements set)
- Filters assets using regex
- Has optional download_callback
- CLI tool can be used in CI
- Handles token from GITHUB_TOKEN env
- Loads updates only when it's needed (caches last version used)
- Loggs own actions
- Uses only few GitHub API endpoints (don't download code, you've never needed)