Personal developer analytics from your git repos
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
git_metrics-0.1.0.tar.gz
(14.7 kB
view details)
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 git_metrics-0.1.0.tar.gz.
File metadata
- Download URL: git_metrics-0.1.0.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
528d5119ed90ab1532edab383532b2f3831784e828d6ee171d3e2043b329950b
|
|
| MD5 |
f7fe15a0630b88b3d2b67f0b4d84de4a
|
|
| BLAKE2b-256 |
46923bbdf3aa617e4b68ec958d9e8f53a777d7abfa6b8503f92a64a1d34eed5d
|
File details
Details for the file git_metrics-0.1.0-py3-none-any.whl.
File metadata
- Download URL: git_metrics-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e558dcaa3b5bdd85ca41acc4f6c4e14d7d29342a85c25cac234a42262e21517
|
|
| MD5 |
35436bed92998f70607c5d7ebc787090
|
|
| BLAKE2b-256 |
18dbdaf5169b8c540a09032fc3cbd380fd7611c93ffb31e0127c46cb49a7c20e
|