Skip to main content

GitHub repository health analyzer — scores repos 0-100 across commit momentum, bus factor, issue resolution, PR latency, and release cadence

Project description

gh-analyzer

A command-line tool that scores GitHub repository health across commit momentum, bus factor, issue resolution, PR latency, and release cadence.

Installation

pip install gh-analyzer

Requires Python 3.11+.

Authentication

Set a GitHub Personal Access Token to raise the rate limit from 60 to 5,000 requests/hour:

Mac/Linux:

export GITHUB_TOKEN=your_token_here

Windows:

set GITHUB_TOKEN=your_token_here

Without a token the tool is limited to 60 requests/hour and results may be incomplete.

Usage

gh-analyzer OWNER/REPO [options]

Options

Flag Default Description
--since DAYS 30 How many days back to analyze
--limit N 100 Maximum number of results to fetch
--format text Output format: text or json
--token TOKEN GitHub token (overrides GITHUB_TOKEN)
--no-token Force unauthenticated mode
--validate-token Validate token before running
--verbose Enable debug logging

Examples

gh-analyzer psf/requests
gh-analyzer psf/requests --since 90
gh-analyzer psf/requests --format json
gh-analyzer torvalds/linux --since 30 --verbose

Output

The tool produces a full health report including:

  • Commit activity and top contributors
  • Issue resolution rate and average resolution time
  • Pull request merge rate and average merge time
  • Release cadence
  • Health score (0–100, grade A–D) weighted across five signals
  • Risk flags (ERROR / WARN / OK) with plain-language descriptions
  • JSON output via --format json for machine consumption

Scoring Model

Signal Weight Description
Commit momentum 30% Activity trend vs prior period
Bus factor 25% Contributor concentration via HHI
Issue health 20% Resolution rate
PR latency 15% Average time from open to merge
Release cadence 10% Days since last release

Bus factor uses the Herfindahl-Hirschman Index (HHI) to measure contributor concentration. HHI closer to 1.0 means one person dominates. HHI closer to 0.0 means contributions are evenly distributed.

Project Structure

gh-analyzer/
├── gh_analyzer/
│   ├── main.py          # Entry point and fetch orchestration
│   ├── cli.py           # Argument parsing
│   ├── github_api.py    # Async GitHub API client with rate limit handling
│   ├── models.py        # Domain models
│   ├── exceptions.py    # Structured error types
│   ├── analytics.py     # Health scoring engine
│   ├── risk.py          # Risk flag detector
│   └── reporter.py      # Rich terminal output and JSON serialization
├── tests/
│   ├── test_risk.py
│   └── test_rate_limit_warning.py
├── pyproject.toml
└── README.md

License

MIT

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

gh_analyzer-0.1.2.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gh_analyzer-0.1.2-py3-none-any.whl (26.3 kB view details)

Uploaded Python 3

File details

Details for the file gh_analyzer-0.1.2.tar.gz.

File metadata

  • Download URL: gh_analyzer-0.1.2.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.4 CPython/3.13.5 Windows/11

File hashes

Hashes for gh_analyzer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 55c92903e75d5ee5b6f66fed8c793eee5e901e9afce5887c6ca9e24d6a00c7cf
MD5 62e3776fc392cb8b11adca486a745a12
BLAKE2b-256 7d55b235a4fcb966a5232ad8b96fdf0f17ee16ecdb528fe1cef8782502ada0e1

See more details on using hashes here.

File details

Details for the file gh_analyzer-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: gh_analyzer-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 26.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.4 CPython/3.13.5 Windows/11

File hashes

Hashes for gh_analyzer-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 67c7d344c0c7f44579d103ac98e577505f4b9b4515aa8df66d60ba07b9667f87
MD5 3fae6af303a1f24ac6d2ddf4e3b987ca
BLAKE2b-256 e652c2aa7d5898faaf9fa9fd4efb89e57a0d2ea5bfe384f6694e95d33ca9e110

See more details on using hashes here.

Supported by

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