Skip to content

Repository files navigation

Gradle CI codecov

GitHub Stats 📈

Playground for exploring Github API and collect some PR review stats for different users/contributors.

🚧 Initial work done (see limitations) 🚧
👷‍♂️ Ready for experimental use!

Background

This project exist to explore GitHub API to get some common answer about PR review time by different reviewers.

What it is NOT

  • ❌ It is not a comprehensive GitHub statistics generator tool. Built for specific purpose.
  • ❌ It is not a modular tool that can be re-used to query GitHub APIs.
  • ❌ Existing supported stats are not localized for different work hour or weekends. Supports North American timezones (and limited other cities).
  • ❌ It does not follow all industry standards, and does not strive to be performant either.

What it is ✔️

  • ✅ It can show you PR statistics for PRs created by specific author/contributor of a repository
  • ✅ It can generate CSV for the PR stats which can be used in Google Sheets or alike to generate charts
  • ✅ It can also generate basic chart/graph using Google Chart to visualize the PR stats
Limitation
  • 🏋️ It does not collect stats in parallel to avoid GitHub API rate-limit and adds delay between API calls, resulting in longer wait time for larger date span with lot of PRs.
  • 🏋️ It is NOT able to accurately compute PR review time due to many complexities. The review time is provided for informational purpose only.
  • 🔐 The generated API token must have access to repository and user in the orginization, otherwise all API request will fail.

Setup 🛠

See SETUP for details on how to setup the project using IntelliJ IDEA.

API Client Options

This project supports two API client implementations:

  • Retrofit/OkHttp (default) - Faster with built-in HTTP caching, requires GitHub token
  • GitHub CLI - Uses gh command, simpler setup with existing CLI authentication

See API Clients Guide for detailed comparison, setup instructions, and best practices.

Quick Start ▶️

# 1. Clone the repository
git clone https://github.com/hossain-khan/github-stats.git
cd github-stats

# 2. Initialize `local.properties` with automatic date setup
./local-prop-init.sh

# 3. Edit `local.properties` and add your:
#    - GitHub access token
#    - Repository details
#    - Author list

# 4. Run the stats generator
./gradlew run

How

The program collects all the related data to user's via different GitHub APIs and compiles releavant data into stats. Those stats are then run through StatsFormatter to generate files.

Here is an quick overview of how stats generation works.
Stats Generator Flow

Sample

Here is some data generated from freeCodeCamp repository. See 📊 demo.

Generate files
Dashboard - Light Dashboard - Dark
Screenshot 2026-08-19 at 15-46-13 freeCodeCamp Analytics Dashboard Screenshot 2026-08-19 at 15-47-06 freeCodeCamp Analytics Dashboard
- -
PR Author - Light PR Author - Dark
Screenshot 2026-08-19 at 15-46-40 Author Analytics - majestic-owl448 (freeCodeCamp) Screenshot 2026-08-19 at 15-46-50 Author Analytics - majestic-owl448 (freeCodeCamp)
- -
Reviewer - Light Reviewer - Dark
Screenshot 2026-08-19 at 15-49-23 Reviewer Analytics - DanielRosa74 (freeCodeCamp) Screenshot 2026-08-19 at 15-49-16 Reviewer Analytics - DanielRosa74 (freeCodeCamp)

References

About

Playground for exploring Github API and collect some stats for PR review.

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages