Skip to main content

Build Status Code Quality Coverage Version Support License

Description

  • Python script to obtain GitHub Release download count and other statistics.

  • Can be used as both a standalone script and a Python module.

Installation

You can get ghstats using one of the following methods:

Usage

ghstats [user] [repo] [tag] [options]
ghstats [user/repo] [tag] [options]
  • Arguments:

Argument

Description

user

Repository owner. If not present, user will be prompted for input.

repo

Repository title. If not present, user will be prompted for input.

tag

Release tag name. If not present, prints the total number of downloads.

  • Options:

Option

Description

-d, --detail

Print detailed statistics for release(s).

-q, --quiet

Print only resulting numbers and errors. Overrides -d option.

-l, --latest

Get stats for the latest release. Tag argument will be ignored.

-h, --help

Show help on script usage.

  • Environment Variables:

Environment Variable

Description

GITHUB_TOKEN

GitHub OAuth token. Use to increase API request limit.

Examples

Examples for atom/atom repository:

ghstats atom atom            # Fetch download count for all releases.
ghstats atom/atom            # Fetch download count for all releases (alt. syntax).
ghstats atom atom -q         # Quiet mode (print only numerical result).
ghstats atom atom -d         # Detailed description for every release.
ghstats atom atom -l         # Fetch download count for the latest release.
ghstats atom atom -l -d      # Detailed description for the latest release.
ghstats atom atom -l -q      # Quiet mode for the latest release.
ghstats atom atom v1.0.0     # Fetch download count for "v1.0.0" release.
ghstats atom atom v1.0.0 -d  # Detailed description for "v1.0.0" release.
ghstats atom atom v1.0.0 -q  # Quiet mode for "v1.0.0" release.
ghstats                      # Get input for username and repository from user.
ghstats -h                   # Print help.

Changelog

v2.0.0

  • Add support for GitHub API pagination.

  • Drop support for Python 2.

v1.2.0

  • Fix error on empty release title (issue #5).

v1.1.1

v1.1.0

  • Fix error on Unicode titles (issue #1).

  • Fix error on draft release (issue #4).

v1.0.1

v1.0.0

  • Initial release.

License

MIT License

You are free to use, modify, distribute (including commercial purposes) as long as you credit the original author and include the license text.

License text: MIT License

Release files for ghstats 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ghstats 2.0.0
File Size Uploaded
ghstats-2.0.0.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ghstats 2.0.0
File Interpreter ABI Platform
ghstats-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.7 kB

Release files / ghstats-2.0.0.tar.gz

Download URL ghstats-2.0.0.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8309de9a698eb00a964887b4decb37bbc54e6abbb66bb4412c10983a8431302d
BLAKE2b-256 checksum
How to use checksums
1d3ab70059befaa233ac613ce837f3e465424c783fd142b182815c67c4262e10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

Release files / ghstats-2.0.0-py3-none-any.whl

Download URL ghstats-2.0.0-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d80ed95bd856395e654c400347197ca01d23d80b61890477415b06fa31e4345
BLAKE2b-256 checksum
How to use checksums
5556749a89faa1e39821458b3ae295bab8e5f2e89a8ce0a8063aebec7375e4c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.2.0

2 release files

1.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page