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.3.tar.gz (23.4 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.3-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gh_analyzer-0.1.3.tar.gz
  • Upload date:
  • Size: 23.4 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.3.tar.gz
Algorithm Hash digest
SHA256 75a63703c9b1060fb0fe16f0282a80f85bc9466f19b7f13801654ab8121e5364
MD5 9e8d90c22638186990160de9bce7bde9
BLAKE2b-256 cdb76f6e4f70f7e02646c75e89c672b3371a6f35e5d708b3e262dc6661b1eef0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gh_analyzer-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 28.4 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2b7ba0f693bc383f6f9eb8979f2cfc4bd8f8177fdabd6130a4a20d53318eb699
MD5 da2d5cec25c476ed76d73e23e1c6483e
BLAKE2b-256 9992e31f9c18f5e4e7bacef3812a19a76f8ea8a9bf5e2a76367792443fb93dd2

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