Skip to main content

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

Latest Version

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:

Contributing

If you'd like to help improve github-download-counts, pull requests will be welcomed!

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details.

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_download_counts-1.0.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

github_download_counts-1.0.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file github_download_counts-1.0.1.tar.gz.

File metadata

File hashes

Hashes for github_download_counts-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d550b3ab8da516360f8e1cc8165a1df06fcba10a317d44d1df54ad81fce9e9ef
MD5 0dedc812e7173276fb0dbef39e489771
BLAKE2b-256 6a58322f2a2b33743d982646af5cf6e0c79d87f02c4e4550ca7ee0f5855bd14c

See more details on using hashes here.

File details

Details for the file github_download_counts-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for github_download_counts-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 78c3d767df6e195ac85e2b1339fe1fccfaba54ca5cdc630fee9ffd3f37f48ff3
MD5 6301eef92d8bf8b1ac1a3665dd3ee2a9
BLAKE2b-256 c0f6eff1a6cb371313bc3086b3cc08ba7e99612dac9d18bbd431f0dddc1d2ac6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page