Skip to content

zehedisodef1-oss/gitstats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ˆ gitstats

PyPI version Python 3.8+ License: MIT CI

Deep git repo analytics in your terminal β€” contributors, hotspots, code churn, effort estimation & beautiful ASCII reports.

Know your codebase like never before. One command, zero config.

gitstats demo

✨ Features

  • πŸ” Full repo analysis β€” commits, contributors, files, churn, frequency heatmap
  • πŸ”₯ Hotspot detection β€” find your most-changed files
  • πŸ“Š ASCII bar charts β€” beautiful Rich-powered terminal output
  • ⏱️ Effort estimation β€” approximate developer hours & sessions
  • πŸ”Ž Blame viewer β€” who owns each line, with ownership summary
  • πŸ“‹ One-line summary β€” "2,341 commits by 12 devs across 890 files over 3.2 years"
  • βš–οΈ Repo comparison β€” compare two repos side by side
  • πŸ“¦ JSON output β€” pipe into jq or your favorite tool
  • πŸš€ Zero config β€” just point it at a git repo

πŸš€ Quick Start

# Install
pip install -e .

# Analyze any repo
gitstats analyze /path/to/repo

# One-line summary
gitstats summary /path/to/repo

# Who wrote this file?
gitstats blame src/main.py

# Estimate developer effort
gitstats effort /path/to/repo

# Compare two repos
gitstats compare /path/to/repo1 /path/to/repo2

# JSON output for scripting
gitstats analyze /path/to/repo --format json

πŸ“– Commands

gitstats analyze <path>

Full repo analysis with:

  • Total commits, contributors, files
  • Top contributors (with bar charts)
  • Most-changed files (hotspots)
  • Code churn ratio (added vs deleted)
  • Commit frequency heatmap by hour & day
  • Language distribution
  • Repo age

gitstats blame <file>

Rich blame output showing who owns each line, with an ownership summary at the bottom.

gitstats effort <path>

Estimates developer effort based on commit patterns:

  • Number of coding sessions (3h gap heuristic)
  • Estimated total hours
  • Per-developer breakdown

gitstats summary <path>

One-line repo summary:

πŸ“‹ 342 commits by 5 devs across 127 files over 1.2 years

gitstats compare <repo1> <repo2>

Side-by-side comparison of two repos β€” commits, contributors, files, churn, languages, age.

πŸ”§ Use as a Library

from gitstats.git_helpers import get_summary, get_contributors, get_churn

summary = get_summary("/path/to/repo")
print(summary)  # "342 commits by 5 devs..."

contributors = get_contributors("/path/to/repo")
for c in contributors:
    print(f"{c['name']}: {c['commits']} commits")

churn = get_churn("/path/to/repo")
print(f"Churn ratio: {churn['ratio']}")

πŸ†š Comparison

Feature gitstats git-quick-stats gitstats (Go)
Language Python Bash Go
Rich terminal UI βœ… ❌ ❌
JSON output βœ… ❌ ❌
Effort estimation βœ… ❌ ❌
Repo comparison βœ… ❌ ❌
Zero config βœ… βœ… βœ…
Blame viewer βœ… ❌ ❌
Install size Small Tiny Medium

πŸ“‹ Requirements

  • Python 3.8+
  • Git (in PATH)
  • Rich (auto-installed)
  • Click (auto-installed)

πŸ—ΊοΈ Roadmap

  • SVG/PNG chart export
  • Git merge request analysis
  • Team velocity trends over time
  • Web dashboard mode
  • GitHub/GitLab API integration
  • Config file support (.gitstatsrc)
  • CI/CD pipeline health metrics

πŸ“„ License

MIT β€” see LICENSE


Built with ❀️ by zehedisodef1-oss

About

πŸ“ˆ Deep git repo analytics - contributors, hotspots, churn, effort estimation & beautiful reports

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages