⚡️ repostats
A CLI tool to fetch GitHub repository statistics.
Installation
# Basic installation
pip install repostats
# With TUI support
pip install repostats[tui]
Usage
Command Line Interface (CLI)
# Basic usage - single repository
repostats python/cpython
# Multiple repositories
repostats python/cpython golang/go rust-lang/rust
# With GitHub token for higher rate limits
export GITHUB_TOKEN=your_token_here
repostats python/cpython
# Or pass token directly
repostats python/cpython --token your_token_here
# Output as JSON
repostats python/cpython --format json
# Output as YAML
repostats python/cpython --format yaml
# Save output to a file
repostats python/cpython --format json --output stats.json
# Multiple repos with JSON output to file
repostats python/cpython golang/go --format json -o repos.json
Terminal User Interface (TUI)
For an interactive experience, use the TUI:
# Launch TUI (requires installation with [tui] extra)
repostats-tui
# Launch TUI with a pre-filled repository
repostats-tui python/cpython
The TUI provides:
- Interactive repository input with real-time validation
- Rich formatting with colors and organized sections
- Keyboard shortcuts: Press
rto refresh,qto quit - GitHub token support via
GITHUB_TOKENenvironment variable
Example output
Text format (default):
python/cpython statistics
-------------------------
Stars : 70,399
Forks : 33,713
Open issues : 9,248
Watchers : 1,529
Language : Python
License : NOASSERTION
Size : 754.8 MB
Default branch: main
Latest release: v3.13.0
Created : 2017-02-10T19:23:51Z
Updated : 2025-12-20T23:50:36Z
JSON format:
{
"name": "python/cpython",
"stars": 58000,
"forks": 29000,
"open_issues": 992,
"watchers": 3400,
"language": "Python",
"created_at": "2007-02-20T00:00:00Z",
"updated_at": "2024-01-15T12:34:56Z"
}
YAML format:
name: python/cpython
stars: 58000
forks: 29000
open_issues: 992
watchers: 3400
language: Python
created_at: '2007-02-20T00:00:00Z'
updated_at: '2024-01-15T12:34:56Z'
The command exits with code 1 when the GitHub API request fails (for example, when the repository is missing or you hit a rate limit), which makes it easy to integrate into scripts.
Features
- Two interfaces: Command-line tool and interactive TUI
- Multiple repositories: Fetch stats for multiple repos in a single command (CLI)
- Rich metrics: Stars, forks, issues, watchers, language, license, size, latest release, and more
- Multiple output formats: text (default), JSON, and YAML (CLI)
- File output: Save results to a file with
--output(CLI) - Interactive exploration: Navigate and refresh stats in real-time (TUI)
- GitHub token support: Authenticate to increase rate limits
- Clean output: Accessible formatting for all output types
- Helpful error messages: Clear guidance on rate limits and missing repos
- Exit codes: Non-zero exit on failure for scripting integration (CLI)
- Cross-platform: Works on macOS, Linux, and Windows
Development
# Clone the repository
git clone https://github.com/sahansera/repostats.git
cd repostats
# Create virtual environment
uv venv
source .venv/bin/activate
# Install in development mode (with TUI support)
uv pip install -e ".[dev,tui]"
# Run tests
make test
# Format code
make format
# Type checking
make type-check
# See all available commands
make help
License
MIT
Metadata
Release files for repostats 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| repostats-1.3.0.tar.gz | 13.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| repostats-1.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.5 kB
Release files / repostats-1.3.0.tar.gz
| Download URL | repostats-1.3.0.tar.gz |
|---|---|
| Size | 13.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ec76700942252b12b92a2d4687dd22994875558f373e0c480e1b8f573a4de7b9
|
|
BLAKE2b-256 checksum How to use checksums |
651da095539e2406c67afa5e0475e1021203ccdd2717eb55eae8cb1f2fd099e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Release files / repostats-1.3.0-py3-none-any.whl
| Download URL | repostats-1.3.0-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f5b3b6ab20f9cc8de740786c22ae19d5bc246caaef81009cf546d3201ccb28d
|
|
BLAKE2b-256 checksum How to use checksums |
985e9564a7cade8d112deede755bc2e89c177c0f1a063b509a0b7df7045ca8c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|