Metadata-Version: 2.4
Name: gh-analyzer
Version: 0.1.0
Summary: GitHub repository health analyzer — scores repos 0-100 across commit momentum, bus factor, issue resolution, PR latency, and release cadence
License: MIT
License-File: LICENSE
Keywords: github,analytics,cli,repository,health
Author: Alireza
Author-email: a.reza.eftekhar@gmail.com
Requires-Python: >=3.11,<4.0
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Version Control
Requires-Dist: aiohttp (>=3.9,<4.0)
Requires-Dist: python-dotenv (>=1.0,<2.0)
Requires-Dist: rich (>=13.0,<14.0)
Project-URL: Homepage, https://github.com/Alir3zag/gh-analyzer
Project-URL: Repository, https://github.com/Alir3zag/gh-analyzer
Description-Content-Type: text/markdown

# GitHub Repository Analyzer

A command-line tool that analyzes GitHub repository health across commits, issues, pull requests, and releases.

## Installation

git clone https://github.com/Alir3zag/gh-analyzer.git
cd gh-analyzer
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt

## Authentication

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

export GITHUB_TOKEN=your_token_here

Without a token the tool still works but is limited to 60 requests/hour.

## Usage

python -m gh_analyzer.main 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

python -m gh_analyzer.main psf/requests
python -m gh_analyzer.main psf/requests --since 90
python -m gh_analyzer.main psf/requests --token ghp_xxx

## Project Structure

gh-analyzer/
├── gh_analyzer/
│   ├── __init__.py
│   ├── main.py          # Entry point and fetch orchestration
│   ├── cli.py           # Argument parsing
│   ├── github_api.py    # Async GitHub API client
│   ├── models.py        # Domain models
│   ├── exceptions.py    # Structured error types
│   ├── reporter.py      # Rich terminal output
│   ├── analytics.py     # Health scoring
│   └── cache.py         # Response caching
├── requirements.txt
├── .gitignore
└── README.md

## API Client

- Async requests via aiohttp with semaphore-based concurrency control
- Automatic retry with exponential backoff and jitter
- Primary and secondary rate limit detection and backoff
- Structured exceptions for all failure modes
- Pagination across all list endpoints
