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.1.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.1-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gh_analyzer-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 8c7d6ba2d3e9e27b29200977fda7837ed2e77c40a046bec17087630a4e6edae4
MD5 2e81fcaa6041dd45bba1f054b956b792
BLAKE2b-256 2faf783607468e6b83bd3c8c7d3876ab7ffa424e58073e925ed52bf5ad952143

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gh_analyzer-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 26.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b65b85f0c547972e33c979a50847300e42cad8b07499a2b6accf77b708dfc86c
MD5 afa87b3c46470ad63012143b9f3b5279
BLAKE2b-256 b506cb7d89f1933a06b6d1c839920e736e7f6f7f0bb81074223788272114c061

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