a simple Python wrapper around the GitHub REST API to get download counts for release assets and ghcr.io image pulls for organizations' repositories
Project description
github-download-counts
Usage
usage: github_download_counts.py <arguments>
Display download statistics from GitHub repositories
* Access to the GitHub API is done using your personal access token (PAT).
See https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
for information about PATs.
options:
--verbose, -v Increase verbosity (e.g., -v, -vv, etc.)
-t <str>, --token <str>
GitHub API token
--token-file <str> GitHub API token (read from filename)
-r [REPOS ...], --repo [REPOS ...]
One or more GitHub repository/repositories (e.g., org/repo)
--date-from <str> Human readable date expression for beginning of search time frame (default: Jan 1 1970)
--date-to <str> Human readable date expression for ending of search time frame (default: now)
--release [RELEASEREGEXES ...]
List of regular expressions against which to match releases (e.g., ^v24\.10)
-a [ASSETREGEXES ...], --asset [ASSETREGEXES ...]
List of regular expressions against which to match release assets (e.g., ^\w+.+\.iso\.01$, ^foobar_.*\.tar\.gz$
-i [IMAGEREGEXES ...], --image [IMAGEREGEXES ...]
List of regular expressions against which to match container images (e.g., ^foobar/barbaz$)
--image-tag [IMAGETAGREGEXES ...]
List of regular expressions against which to match container image tags (e.g., ^24\.10)
Installation
Using pip
, to install the latest release from PyPI:
python3 -m pip install -U github-download-counts
Or to install directly from GitHub:
python3 -m pip install -U 'git+https://github.com/mmguero/github-download-counts'
Prerequisites
github-download-counts requires:
- Python 3
- beautifulsoup4
- dateparser
- github3.py
- mmguero
Contributing
If you'd like to help improve github-download-counts, pull requests will be welcomed!
Authors
- Seth Grover - mmguero
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
File details
Details for the file github_download_counts-1.0.1.tar.gz
.
File metadata
- Download URL: github_download_counts-1.0.1.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d550b3ab8da516360f8e1cc8165a1df06fcba10a317d44d1df54ad81fce9e9ef |
|
MD5 | 0dedc812e7173276fb0dbef39e489771 |
|
BLAKE2b-256 | 6a58322f2a2b33743d982646af5cf6e0c79d87f02c4e4550ca7ee0f5855bd14c |
File details
Details for the file github_download_counts-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: github_download_counts-1.0.1-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78c3d767df6e195ac85e2b1339fe1fccfaba54ca5cdc630fee9ffd3f37f48ff3 |
|
MD5 | 6301eef92d8bf8b1ac1a3665dd3ee2a9 |
|
BLAKE2b-256 | c0f6eff1a6cb371313bc3086b3cc08ba7e99612dac9d18bbd431f0dddc1d2ac6 |