GitHub Contribution Graph in your terminal โ for hackers who prefer Unicode over UI
Project description
๐ต๏ธโโ๏ธ GitHub Stats Heatmap
Your GitHub activity, visualized โ hacker style.
Features โข Quick Start โข Installation โข Live Refresh โข Plugins โข Roadmap โข Contributing โข Changelog
๐ What's New
โก Live Refresh Mode (Latest)
Experience real-time GitHub stats with auto-updating displays! Perfect for demos, monitoring, and live presentations.
New Features:
- ๐ Real-time Updates: Auto-refresh every 30+ seconds
- ๐ก๏ธ Rate Limit Protection: Smart handling of GitHub API limits
- ๐ญ Demo Mode: Seamless fallback to realistic sample data
- ๐ Status Indicators: Clear visual feedback (LIVE/RATE LIMITED/DEMO)
- ๐พ Data Caching: Maintains display even when API is unavailable
# Try it now!
ghstats yourusername --live
See the Live Refresh Mode section for complete details.
โจ Features
| Category | Features |
|---|---|
| ๐ฏ Core | Zero-config heatmaps โข Rich terminal output โข Cross-platform |
| ๐จ Themes | GitHub, dark, light, matrix, cyberpunk, monochrome โข Custom JSON themes |
| ๐ Analytics | Streaks, trends, busiest month, activity patterns โข Multiple sparklines โข Advanced analytics โข Smart insights |
| ๐ Compare | Side-by-side user comparison โข Per-user themes โข Diff highlighting โข Overlap analysis |
| ๐ Leaderboards | Repository/organization contributors โข Global top contributors |
| ๐ Plugins | Extensible plugin system โข Global leaderboard plugin |
| ๐ฎ TUI | Interactive terminal UI โข Multiple views โข Cell selection โข Theme switching |
| โก Live | Real-time refresh mode โข Auto-updating displays โข Rate limit protection โข Demo mode โข Smart caching |
๐ Quick Start
# Instant visualization
ghstats yourusername
# Compare two developers
ghstats user1 --compare user2
# With global context
ghstats username --global-leaderboard --token YOUR_TOKEN
# Live refresh for demos
ghstats username --live
# Live refresh with custom interval
ghstats username --live --refresh-interval 60
๐ฆ Installation
๐ Global Install (Recommended)
pipx install ghstats
๐ง From Source
git clone https://github.com/Gizmet/github-contribution-heatmap-viewer
cd github-contribution-heatmap-viewer
pip install -e .
๐ฏ Usage Examples
| Command | Result |
|---|---|
ghstats torvalds |
View Linus's contributions |
ghstats gizmet --theme matrix |
Cyberpunk-style heatmap |
ghstats user1 --compare user2 |
Side-by-side comparison |
ghstats user1 --compare user2 --theme dark --theme2 matrix |
Enhanced comparison with different themes |
ghstats --plugin global-leaderboard |
Top GitHub contributors |
ghstats username --tui |
Interactive TUI mode |
ghstats username --live |
Real-time updates |
ghstats username --live --refresh-interval 30 |
Custom refresh interval |
ghstats username --watch |
Watch mode (alias for --live) |
๐ Plugin System
Available Plugins
ghstats --list-plugins
๐ Global Leaderboard Plugin
Shows top GitHub contributors worldwide using GraphQL API:
# Standalone plugin
ghstats --plugin global-leaderboard --token YOUR_TOKEN
# Integrated with heatmap
ghstats username --global-leaderboard --token YOUR_TOKEN
Features:
- ๐ Resilient - Retry logic, fallback data, network error handling
- ๐ Rich Data - Contributions, followers, rankings
- ๐จ Beautiful Output - Formatted tables with proper alignment
- โก Fast - Optimized GraphQL queries with pagination
๐ฎ Interactive TUI Mode
Experience your GitHub stats with an interactive terminal interface:
# Launch TUI mode
ghstats username --tui
# TUI with custom theme
ghstats username --tui --theme matrix
# TUI with API token
ghstats username --tui --token YOUR_TOKEN
Features:
- ๐ Multiple Views: Heatmap, stats, compare, and settings views
- ๐ฏ Interactive Navigation: Switch views and explore data
- ๐จ Theme Switching: Change themes on the fly
- ๐ Detailed Analytics: Comprehensive statistics tables
- ๐ Data Refresh: Reload data without restarting
Navigation:
h= Heatmap views= Stats viewv= Compare viewo= Settings viewt= Change themer= Refresh dataq= Quit
See TUI.md for complete documentation.
๐จ Themes
Built-in Themes
github- GitHub's official colorsdark- Dark terminal aestheticlight- Light terminal friendlymatrix- Green terminal matrix vibecyberpunk- Neon magenta/yellow/cyanmonochrome- Clean black and white
Custom Themes
Create your own with JSON:
{
"name": "My Theme",
"colors": ["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"]
}
๐ Sample Output
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ๐ต๏ธโโ๏ธ GitHub Stats Heatmap โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ GitHub Contributions: torvalds (Past 52 Weeks) โ
โ โ
โ M โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ T โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ W โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ T โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ F โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ S โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ S โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ Weekly Activity: โโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโ โ
โ Monthly Trend: โโโโโโ โ
โ Consistency: โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ Trend: ๐ Accelerating | Peak: This week (24 contributions) | Consistency: โ
Good (85%) โ
โ โ
โ Legend: โ = 0 โ = 1-3 โ = 4-6 โ = 7+ โ
โ โ
โ โก Current streak: 1 days | ๐ Total contributions: 2885 | ๐
Active days: 344/364 โ
โ (94.5%) | ๐ Longest streak: 66 days | ๐ This month: 170 | ๐ Inactive weeks: 0 | ๐
โ
โ Busiest week: 157 contributions (Week 36) | ๐ฅ Most active weekday: S | ๐ Busiest โ
โ month: May | ๐ด Least active weekday: T | ๐ Avg/week: 55.5 | ๐ Trend: Up (+241) โ
โ โ
โ ๐ฏ Consistency: 85/100 | โก Pattern: Weekday focused (Monday peak, Tuesday low) โ
โ ๐ฑ Seasonal: Strong Summer preference | ๐ Momentum: +25% | ๐
Weekend work: 15% โ
โ โฐ Peak hours: Early week focus (Monday peak) | ๐ด Burnout risk: Low (healthy pace) โ
โ ๐ฏ Improvement: High potential (few gaps) โ
โ โ
โ ๐ญ You've contributed 2885 times in the last 52 weeks. Your consistency is excellent. โ
โ You're a weekday warrior. You show a strong summer preference. You're gaining momentum. โ
โ You prefer weekday work. You have great potential for growth. You're on a 1-day streak โ
โ with increasing activity. โ
โ โ
โ ๐ Global GitHub Contributors โ
โ โโโโโโโโฌโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโ โ
โ โ Rank โ User โ Name โ Contributions โ Followers โ โ
โ โโโโโโโโผโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโผโโโโโโโโโโโโค โ
โ โ 1 โ @Charles-Chrismann โ Charles Chrismann โ 12,290 โ 16,017 โ โ
โ โ 2 โ @lllyasviel โ lllyasviel โ 9,121 โ 19,979 โ โ
โ โ 3 โ @phodal โ Fengda Huang โ 9,052 โ 20,351 โ โ
โ โ 4 โ @skydoves โ Jaewoong Eum โ 7,045 โ 12,058 โ โ
โ โ 5 โ @jeresig โ John Resig โ 6,066 โ 18,881 โ โ
โ โโโโโโโโดโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโ โ
โ โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
๐ ๏ธ API Tokens
When you need tokens:
- ๐ Private repository data
- ๐ Repository/organization leaderboards
- ๐ Global leaderboard plugin
- ๐ Integrated global leaderboard feature
When you DON'T need tokens:
- โ Public profile heatmaps
- โ Basic statistics
- โ Compare mode (public users)
- โ Theme customization
Create tokens at: https://github.com/settings/tokens
๐ง Plugin Development
Extend functionality with custom plugins:
from plugins.base import GhStatsPlugin
class MyPlugin(GhStatsPlugin):
def name(self) -> str:
return "my-plugin"
def description(self) -> str:
return "My custom plugin"
def requires_token(self) -> bool:
return False
def execute(self, **kwargs) -> Dict[str, Any]:
# Your plugin logic here
return {"success": True, "data": "..."}
๐ Roadmap
| Status | Feature | Description |
|---|---|---|
| โ Complete | Core heatmap rendering | Beautiful terminal output with Unicode blocks |
| โ Complete | Theme system | Built-in + custom JSON themes |
| โ Complete | Statistics engine | Streaks, trends, patterns, analytics |
| โ Complete | Compare mode | Side-by-side user comparison |
| โ Complete | Plugin architecture | Extensible plugin system |
| โ Complete | Global leaderboard | Top GitHub contributors worldwide |
| โ Complete | Live refresh | Real-time updates |
| ๐ In Progress | Export features | PNG, HTML, JSON export |
| ๐ In Progress | TUI mode | Interactive terminal UI |
| ๐ Planned | Team analytics | Organization insights |
| ๐ Planned | Historical trends | Year-over-year comparisons |
| ๐ Planned | Custom metrics | User-defined contribution types |
๐๏ธ Project Structure
github-contribution-heatmap-viewer/
โโโ ghstats.py # CLI entry point
โโโ github_api.py # GitHub API integration
โโโ heatmap.py # Grid generation logic
โโโ render.py # Rich terminal rendering
โโโ utils.py # Utility functions
โโโ plugins/ # Plugin system
โ โโโ __init__.py # Plugin manager
โ โโโ base.py # Base plugin class
โ โโโ global_leaderboard.py # Global leaderboard plugin
โโโ tests/ # Test suite
โโโ themes/ # Theme definitions
โโโ README.md # This file
๐งช Development
# Install in development mode
pip install -e .
# Run tests
pytest
# Run with coverage
pytest --cov=.
# Format code
black .
# Lint code
flake8 .
๐ค Contributing
We welcome contributions! Here's how:
- ๐ด Fork the repository
- ๐ฑ Create a feature branch:
git checkout -b feature/amazing-thing - ๐ฅ Commit your changes:
git commit -m 'Add amazing thing' - ๐ Push to the branch:
git push origin feature/amazing-thing - ๐ฌ Open a Pull Request
Guidelines:
- Follow PEP 8 style guidelines
- Add tests for new functionality
- Update documentation for new features
- Write clear commit messages
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Rich - Beautiful terminal rendering
- GitHub API - Data source
- Unicode - For the glorious โโโโ blocks
- committers.top - Inspiration for global leaderboards
Made with โค๏ธ for developers who live in the terminal
โญ Star this repo if you find it useful! โญ
โก Live Refresh Mode
Experience real-time GitHub stats with auto-updating displays perfect for demos, monitoring, and live presentations:
# Basic live refresh (30s minimum interval)
ghstats username --live
# Custom refresh interval
ghstats username --live --refresh-interval 60
# Watch mode (alias for --live)
ghstats username --watch
# Live refresh with compare mode
ghstats username --compare user2 --live
# Live refresh with custom theme
ghstats username --live --theme matrix
๐ฏ Live Refresh Features
- ๐ Auto-Updating: Real-time data refresh with customizable intervals
- ๐ก๏ธ Rate Limit Protection: Automatic detection and graceful handling of GitHub API rate limits
- ๐ญ Demo Mode: Seamless fallback to realistic sample data when rate limited
- ๐ Status Indicators: Clear visual feedback (LIVE/RATE LIMITED/DEMO)
- ๐พ Data Caching: Uses cached data when API calls fail
- โฐ Smart Intervals: Minimum 30-second intervals to prevent rate limiting
- ๐จ Theme Support: Full theme compatibility in live mode
- ๐ Compare Mode: Side-by-side live comparison of multiple users
๐ญ Demo Mode
When rate limited, the live refresh automatically switches to demo mode:
- Realistic Data: Generates authentic-looking contribution patterns
- Weekday Patterns: Higher activity on weekdays, lower on weekends
- Random Variation: Natural-looking contribution counts and patterns
- Seamless Transition: No interruption to the live display
๐ Status Display
Live refresh provides comprehensive status information:
Last update: 14:30:25 | Updates: 15 | Status: LIVE | Next refresh in 60s
Rate limit: 4850/5000 requests remaining | Reset at 15:00:00
Status Types:
[green]LIVE[/green]- Real-time data from GitHub API[yellow]RATE LIMITED[/yellow]- Using cached data due to rate limits[yellow]DEMO[/yellow]- Using sample data in demo mode
๐ก๏ธ Error Handling
- Retry Logic: Automatic retry with exponential backoff
- Graceful Degradation: Falls back to cached data when API fails
- Rate Limit Awareness: Detects and handles GitHub API rate limits
- User Feedback: Clear error messages and status updates
๐ For detailed documentation, see LIVE_REFRESH.md
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gh_stats_heatmap-1.0.0.tar.gz.
File metadata
- Download URL: gh_stats_heatmap-1.0.0.tar.gz
- Upload date:
- Size: 1.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12c92eb0906673bd1307c335ba4d5b1a79407663d3b797f93f78d0569486c983
|
|
| MD5 |
cdd6a97ebea9be565e389cb746e26d2b
|
|
| BLAKE2b-256 |
e987e33ad2a7413e9aa2f31eb12b0ea1d1ef83215c23b13f71a011066f2b0107
|
File details
Details for the file gh_stats_heatmap-1.0.0-py3-none-any.whl.
File metadata
- Download URL: gh_stats_heatmap-1.0.0-py3-none-any.whl
- Upload date:
- Size: 31.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e98d7234f976dd0ad837eb8264f54b7982cda906c5fb163d494bf9dba68a9cf
|
|
| MD5 |
12c90a48b5d5fb7eb51b53c1fc2f0278
|
|
| BLAKE2b-256 |
039d340802b1dcd9d9c8a8d61c391e09adaad73d145c471b44578c9b6909e65f
|