Skip to content

Pavankumardhruv/ghstat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ghstat

Analyze any GitHub profile from the terminal.
Repos, languages, activity, and contribution insights — all from the command line.

License Python GitHub API


ghstat fetches public GitHub data and renders it as rich terminal output — profile cards, repo rankings, language breakdowns with bar charts, and activity timelines.

No API key required for basic usage. Set GITHUB_TOKEN for higher rate limits.

Quick Start

# Install
git clone https://github.com/Pavankumardhruv/ghstat.git
cd ghstat
pip install -e .

# Analyze a profile
ghstat profile torvalds

# List top repos
ghstat repos torvalds --limit 15

# Language breakdown
ghstat languages torvalds

Commands

ghstat profile <username>

Full profile overview — identity, stats, top repos, and 12-month activity chart.

╭──────────── @torvalds ────────────╮
│       Name  Linus Torvalds        │
│        Bio  —                     │
│   Location  Portland, OR          │
│                                   │
│  Public Repos  8                  │
│  Total Stars   ⭐ 221,402        │
│  Total Forks   🍴 52,118         │
│  Followers     223,819            │
│                                   │
│  Top Language  C                  │
│  Languages     4                  │
╰───────────────────────────────────╯

ghstat repos <username>

Ranked repo table sorted by a weighted score (stars × 3 + forks × 2).

┌─────────────────── Top Repositories ───────────────────┐
│ Repository   │ Language │ Stars   │ Forks  │ Last Push │
├──────────────┼──────────┼─────────┼────────┼───────────┤
│ linux        │ C        │ 185,612 │ 45,201 │ 2026-04-… │
│ subsurface   │ C++      │ 2,891   │ 1,052  │ 2025-11-… │
└──────────────┴──────────┴─────────┴────────┴───────────┘

ghstat languages <username>

Bar chart showing language distribution across all non-fork repos.

┌──────── Language Breakdown ────────┐
│ Language │ Repos │ %     │         │
├──────────┼───────┼───────┼─────────┤
│ C        │     3 │ 42.9% │ █████░░ │
│ C++      │     2 │ 28.6% │ ████░░░ │
│ Shell    │     1 │ 14.3% │ ██░░░░░ │
└──────────┴───────┴───────┴─────────┘

Architecture

ghstat/
├── cli.py         # Typer CLI commands
├── api.py         # GitHub API client with pagination
├── analytics.py   # Scoring, language stats, activity timelines
└── display.py     # Rich terminal rendering (panels, tables, charts)

Design decisions:

  • No auth required — Works with public GitHub API. Optional GITHUB_TOKEN raises the rate limit from 60 to 5,000 requests/hour.
  • Fork filtering — Forks are excluded from all stats to show original work only.
  • Weighted ranking — Repos are scored by stars × 3 + forks × 2, surfacing high-impact projects.
  • Pagination — Handles users with 100+ repos by fetching all pages automatically.

Optional: Set a GitHub Token

For heavy usage or private repo access:

export GITHUB_TOKEN=your-token-here

Generate one at github.com/settings/tokens (no scopes needed for public data).

Requirements

  • Python 3.10+

License

MIT License — see LICENSE for details.

About

Analyze any GitHub profile from the terminal. Repos, languages, activity, and contribution insights.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages