git-stats
Personal developer analytics from your git repos. Lines of code, commit patterns, most productive hours, streak tracking. Like GitHub's contribution graph but way deeper and for all your repos.
Install
pip install git-stats
Or from source:
git clone https://github.com/hiren-thakore/git-stats-cli.git
cd git-stats-cli
pip install -e .
Usage
# Summary dashboard for current repo
git-stats
# Time filters
git-stats --week # Last 7 days
git-stats --month # Last 30 days
# Author filter
git-stats --author "John Doe"
# All repos in parent directory
git-stats --all
# Subcommands
git-stats heatmap # Contribution heatmap
git-stats streaks # Current and longest streaks
git-stats hours # Most productive hours
git-stats days # Most productive days of week
git-stats files # Most changed files
git-stats langs # Language breakdown
git-stats blame <file> # Who owns each line
git-stats summary # One-line summary (for shell prompts)
git-stats export --json # Export stats as JSON
git-stats report # Full markdown report
Examples
Dashboard
$ git-stats
╭── Git Stats — myapp ──────────────────────────────────────╮
│ │
│ Commits: 47 (avg 1.6/day) │
│ Lines added: 3,247 │
│ Lines deleted: 1,891 │
│ Net lines: +1,356 │
│ Files changed: 83 │
│ Active days: 22/30 (73%) │
│ │
│ Current streak: 5 days │
│ Longest streak: 12 days │
│ │
│ Most productive: 10am - 1pm (62% of commits) │
│ Busiest day: Wednesday (9 commits) │
│ │
│ Top files changed: │
│ 1. src/api.py (23 commits) │
│ 2. src/models.py (18 commits) │
│ 3. tests/test_api.py (14 commits) │
│ │
│ Languages: │
│ Python 68% (57 files) │
│ YAML 18% (15 files) │
│ Shell 14% (11 files) │
│ │
╰─────────────────────────────────────────────────────────────╯
Heatmap
$ git-stats heatmap
Mon Tue Wed Thu Fri Sat Sun
W1 · · · · · · ·
W2 · · 3 2 5 1 ·
W3 4 2 7 1 3 · ·
W4 2 5 4 6 2 1 ·
W5 3 4 8 3 2 · ·
· = no commits number = commit count
Total: 71 commits over 5 weeks
Shell Prompt
# In your .bashrc / .zshrc
export PS1='$(git-stats summary) $ '
# Output: 47 commits | +1356 lines | 5d streak $
Development
pip install -e ".[dev]"
pytest tests/ -q
License
MIT
Metadata
Release files for git-metrics 0.1.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 | |
|---|---|---|---|
| git_metrics-0.1.0.tar.gz | 14.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| git_metrics-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.0 kB
Release files / git_metrics-0.1.0.tar.gz
| Download URL | git_metrics-0.1.0.tar.gz |
|---|---|
| Size | 14.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
528d5119ed90ab1532edab383532b2f3831784e828d6ee171d3e2043b329950b
|
|
BLAKE2b-256 checksum How to use checksums |
46923bbdf3aa617e4b68ec958d9e8f53a777d7abfa6b8503f92a64a1d34eed5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / git_metrics-0.1.0-py3-none-any.whl
| Download URL | git_metrics-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4e558dcaa3b5bdd85ca41acc4f6c4e14d7d29342a85c25cac234a42262e21517
|
|
BLAKE2b-256 checksum How to use checksums |
18dbdaf5169b8c540a09032fc3cbd380fd7611c93ffb31e0127c46cb49a7c20e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|