Skip to main content

📊 git-insights

PyPI version Python 3.10+ License: MIT

Analyze git repositories for commit patterns, contributor stats, code churn, and team productivity insights.

Turn your git history into actionable insights. git-insights analyzes commit patterns, identifies code hotspots, calculates bus factor, scores repository health, and generates beautiful reports — all from the command line.


✨ Features

Feature Description
📈 Commit Analytics Total commits, lines changed, merge ratios, trends
👥 Contributor Stats Leaderboard with commits, lines, active days per author
🔥 File Hotspots Identify most churned files (high change + high commits)
📅 Day Distribution Which days of the week see the most commits
🕐 Hour Heatmap Activity pattern by hour of day
📊 Monthly Trends Commit frequency over time with bar charts
🏥 Health Score 0-100 repository health grade (A+ to F)
🚌 Bus Factor How many contributors cover 50% of commits
📋 File Types Changes breakdown by file extension
🌐 HTML Reports Beautiful dark-themed dashboards
📄 JSON Export Machine-readable output for CI/CD integration
⏰ Time Filtering Analyze specific date ranges with --since/--until

📦 Installation

pip install git-insights-cli

🚀 Quick Start

# Full analysis of current repo
git-insights analyze .

# Generate HTML dashboard
git-insights analyze . --html report.html

# Last 6 months only
git-insights analyze . --since "6 months ago"

# Quick summary
git-insights summary .

# Contributor leaderboard
git-insights contributors .

# File hotspots
git-insights hotspots .

# Activity patterns
git-insights activity .

📖 Commands

analyze — Full repository analysis

git-insights analyze <PATH> [OPTIONS]

Options:
  --since TEXT   Start date (e.g., '2024-01-01', '6 months ago')
  --until TEXT   End date
  --html PATH    Export HTML dashboard report
  -j PATH        Export JSON report

Generates comprehensive analysis including:

  • Summary stats (commits, lines, age, bus factor)
  • Top contributors leaderboard
  • Day-of-week distribution with bar charts
  • Hour-of-day activity heatmap
  • File hotspot table (churn score ranking)
  • Monthly commit trend
  • File type breakdown
  • Health score (A+ to F grade)

contributors — Contributor leaderboard

git-insights contributors <PATH> [--top N]

hotspots — Most churned files

git-insights hotspots <PATH> [--top N]

Files with high churn scores (changes × commits) are potential refactoring candidates.

activity — Commit activity patterns

git-insights activity <PATH>

Shows day-of-week distribution and hour-of-day heatmap.

summary — Quick health check

git-insights summary <PATH>

🏥 Health Score

The health score (0-100) considers:

Factor Bonus
3+ contributors +10
Last commit < 7 days +15
Last commit < 30 days +10
Bus factor ≥ 3 +10
≥ 1 commit/day avg +10
Healthy merge ratio +5

Grades: A+ (90+), A (80+), B (70+), C (60+), D (50+), F (<50)


📊 HTML Dashboard

git-insights analyze . --html report.html

The dark-themed dashboard includes:

  • Summary cards — commits, contributors, lines, bus factor, health grade
  • Contributor table — ranked by commits with add/delete stats
  • Day distribution — bar chart showing weekday vs weekend patterns
  • Hour heatmap — 24-hour activity visualization
  • File hotspots — most churned files with churn scores
  • Monthly trend — commit frequency over time
  • File types — changes by extension

🔄 CI/CD Integration

JSON Output

git-insights analyze . -j insights.json

Returns structured JSON with all metrics for dashboards or monitoring.

GitHub Actions

- name: Git Insights
  run: |
    pip install git-insights-cli
    git-insights analyze . -j insights.json --html report.html

🧪 Development

git clone https://github.com/SanjaySundarMurthy/git-insights.git
cd git-insights
pip install -e ".[dev]"
pytest tests/ -v
ruff check .

📋 Requirements

  • Python 3.10+
  • Git (accessible via command line)
  • click >= 8.0
  • rich >= 13.0

📄 License

MIT License — see LICENSE for details.


👤 Author

Sanjay S — GitHub · PyPI


🏆 Other Tools

Tool Description PyPI
secret-scanner Credential & secret leak detector secret-scanner-cli
docker-lens Dockerfile analyzer & optimizer docker-lens-cli
yaml-doctor YAML linter for K8s, Compose, GHA yaml-doctor-cli

Metadata

Release files for git-insights-cli 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for git-insights-cli 1.0.0
File Size Uploaded Provenance
git_insights_cli-1.0.0.tar.gz 18.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for git-insights-cli 1.0.0
File Interpreter ABI Platform
git_insights_cli-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 37.0 kB

Release files / git_insights_cli-1.0.0.tar.gz

Download URL git_insights_cli-1.0.0.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
37d1806e6fa626e71d1b0cc90609c64efbb803f584e98873cc397f2012bd3789
BLAKE2b-256 checksum
How to use checksums
6593f02f86e1d1be8aba7e452d2ae22b1b8184854ee8d164ced3edaa9a1429da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / git_insights_cli-1.0.0-py3-none-any.whl

Download URL git_insights_cli-1.0.0-py3-none-any.whl
Size 18.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
47e7e80d1b30615e34a4600e4c0728eb447571550c22c96d51e4aad1c71a157d
BLAKE2b-256 checksum
How to use checksums
89427d430a50d23f75bd4bacc16615b80d668e7bb63ec7dc1c0d32283e8e8769
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Security for git-insights-cli 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page