Skip to main content
gitstats — git history statistics gitstats — git history statistics

PyPI - Version PyPI - Python Version PyPI Downloads Test Documentation GitHub contributors GitHub Marketplace

$ gitstats

📊 Generate insightful visual reports from Git.

📘 Documentation: gitstats.readthedocs.io 📊 GitStats Gallery: shenxianpeng.github.io/gitstats/gallery/

Example

gitstats . generates this gitstats report.

Check out the GitStats Gallery for live reports on the world’s largest open-source projects — auto-generated weekly.

gitstats terminal demo

Installation

pip install gitstats

Or, using uv (recommended):

uv pip install gitstats      # install into current environment
uvx gitstats .              # run instantly, no install required

gitstats is compatible with Python 3.10 and newer.

Usage

gitstats <gitpath> [<outputpath>]

If <outputpath> is omitted, reports are written to gitstats-report/ by default.

Analyze several repositories at once to get a portfolio overview — useful for seeing how all of a team’s projects are doing in one place:

gitstats repo1 repo2 repo3 <outputpath>

Each repository gets its full report in <outputpath>/<repo>/ along with a machine-readable summary.json, and an aggregate page at <outputpath>/index.html shows a sortable table of every repository — commits, authors, recent activity, lines of code and a health label — linking into the individual reports. Repositories that fail to analyze are listed on the page without stopping the run.

Use --verbose to show debug-level command logs, or --quiet to show only warnings and errors:

gitstats --verbose .
gitstats --quiet .

Run gitstats --help for more options, or check the documentation.

GitHub Action

Automate your gitstats report generation with the official GitStats Action.

- uses: shenxianpeng/gitstats-action@v0.1.1
  with:
    deploy-to-pages: true

With just one uses line, the Action generates a full gitstats report and deploys it to GitHub Pages automatically.

See the gitstats-action repository for detailed inputs, examples, and advanced usage (AI-powered reports, custom config, manual deploy, etc.).

What’s New in v2.0.0

v2.0.0 is a major release focused on modernizing the report UI and removing the Gnuplot dependency.

Terminal-inspired UI redesign

The entire report interface has been redesigned with a terminal / OpenCode-inspired aesthetic: zero border-radius (sharp, angular corners), monospace fonts in headings and navigation, border-heavy layout, and a GitHub-style green heatmap. Both light and dark modes are supported with a one-click toggle — no flash of unstyled content when switching pages.

Chart.js replaces Gnuplot

All charts are now rendered interactively in the browser using Chart.js. Gnuplot is no longer required. Reports are fully self-contained HTML files.

Features

Here is a list of some features of gitstats:

  • General: total files, lines, commits, authors, age.

  • Activity: commits by hour of day, day of week, hour of week, month of year, year and month, and year.

  • Authors: list of authors (name, commits (%), first commit date, last commit date, age), author of month, author of year.

  • Files: file count by date, extensions.

  • Lines: line of code by date.

  • Tags: tags by date and author.

  • Customizable: config values through gitstats.conf.

  • Cross-platform: works on Linux, Windows, and macOS.

AI-Powered Features 🤖

GitStats supports AI-powered insights to enhance your repository analysis with natural language summaries and actionable recommendations.

Quick Start:

# Install with AI support
pip install gitstats[ai]

# Enable AI with OpenAI
export OPENAI_API_KEY=your-api-key
gitstats --ai --ai-provider openai <gitpath> [<outputpath>]

For detailed setup instructions, configuration options, and examples, see the AI Integration Documentation.

Contributing

As an open source project, gitstats welcomes contributions of all forms.


The gitstats project was originally created by Heikki Hokkainen and is currently maintained by Xianpeng Shen.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitstats-2.5.0-py3-none-any.whl (135.1 kB view details)

Uploaded Python 3

File details

Details for the file gitstats-2.5.0-py3-none-any.whl.

File metadata

  • Download URL: gitstats-2.5.0-py3-none-any.whl
  • Upload date:
  • Size: 135.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for gitstats-2.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10d1184cb975ba0fb1f08abca8e8c9c584aa886588bbff2a6563ec7b4f5f0de6
MD5 d659ebb5aae1c6f5ba76fce72deaf18a
BLAKE2b-256 5c633f00494abf377bb4feab120f39e1c61359c6c442b15ae54644a782fb7694

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page