$ gitstats
📊 Generate insightful visual reports from Git.
📘 Documentation: gitstats.readthedocs.io 📊 GitStats Gallery: shenxianpeng.dev/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 — and its AI-assisted commits page: how many of each project’s commits name an AI coding assistant, quarter by quarter. Its counts can be downloaded as JSON or CSV, and each quarter is kept as it was first published. Its Organizations page adds up which organizations’ addresses commit to the gallery’s projects, and each organization has a page and a badge, such as google.com. Each project has a page of how it compares with the others of its ecosystem, such as Kubernetes. The top of each project’s report says what stands out about it next to the others: up to three facts, such as the days with a commit or how far its AI-assisted commits rose in a year, said only where it is in the top or bottom 15%. The repositories are listed by ecosystem in gallery/repos.yml; to suggest one, open an issue. Each ecosystem has its ranking by AI-assisted commits, also as JSON (fields).
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. A second page, <outputpath>/ai.html, compares the share of commits that name an AI coding assistant in each repository over the last four quarters. Its counts are written next to it as ai.json and ai.csv, month by month, and the first run after a quarter ends keeps a copy of ai.json in ai/<year>-Q<n>.json that later runs leave as it is. A third page, <outputpath>/organizations.html, adds up the organizations whose addresses commit to the repositories, by the domain of the address, and shows for each repository how its commits of the last four quarters divide between organizations, one-person domains, personal mail, hidden addresses and bots. Its counts are written next to it as organizations.json and organizations.csv: domains and counts, never an address. The 200 organizations with the most commits in the last 12 months each get a page, <outputpath>/orgs/<domain>.html, with their commits to each repository and a badge to show them (orgs/<domain>.svg, and a shields.io endpoint, orgs/<domain>.json). With five repositories or more, each also gets <repo>/compare.html: how it compares with the others on commits, contributors, new contributors, how widely its commits are spread, organizations and AI-assisted commits, with every repository as a dot on a strip, its rank, and a sentence on where it stands out; and a share card, <repo>/compare-card.html. The numbers are in compare.json.
Add --serve to preview the generated report right away — gitstats starts a local web server and prints the URL (bound to 127.0.0.1 by default; pass --host 0.0.0.0 to expose it on your network, --port to pick a port):
gitstats --serve .
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@v1
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.).
Repo Wrapped Card
Add --wrapped to also get a “Repo Wrapped” card: a square (1080×1080) SVG image written next to the report as wrapped-<year>.svg, made for sharing.
gitstats --wrapped .
gitstats --wrapped --wrapped-theme sunset . # midnight (default), sunset or clean
gitstats --wrapped --wrapped-year 2025 . # the card for another year
gitstats --wrapped --wrapped-output card.svg . # write it to another file
The card is about one year, the current one by default, and every number on it is that year’s: commits, active days, longest streak, lines changed, contributors, releases (or new contributors, in a year without a release), the busiest month and weekday, the top contributor, the commits in each month and the part of the day most of them were made in. A year without commits gets no card: gitstats says so and names the last year that has any.
The report shows the card on its Badges page, with a snippet to put it in a README, and links to it from its year on the History page.
With several repositories, each one gets its card in its own report directory; --wrapped-output names a single file, so it only works with one repository.
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: headline numbers (commits, authors, lines, files, active days, longest streak), commits per year, top contributors, latest releases.
Activity: commits by year, month and week; a punch card of day of week by hour of day; month of year; timezones.
Authors: every author’s commits, lines and active span; a contributor timeline; cumulative lines added per author; the top author per year and month; commits by organization, from the domain of each author’s address, and by quarter how many come from organizations, personal mail, hidden addresses and bots; commits by email domain; contributor growth; and the commits that name an AI coding assistant, by month and by assistant.
Files: file count over time, extensions ranked by lines, and the most-changed files.
Lines: lines of code over time, and lines added and removed per month.
Tags: every tag with its commits and authors.
Code Ownership: the bus factor, bus-factor risk (files only one person has changed), ownership by author, and the files shared by the most people.
Hotspots: every file plotted by its size against how often it changes, and the large, frequently changed files ranked by score, with how many people have changed each.
History: the project’s life one year at a time — its peaks, quiet years and revivals, newcomers and releases — with optional AI narration.
Portfolio: analyze several repositories at once for an aggregate overview, with a page that compares their AI-assisted commits quarter by quarter.
Wrapped card: a shareable SVG card of one year in the repository, with --wrapped.
Readable anywhere: interactive charts, light and dark themes, and layouts that work on phones; long quiet periods are shaded on every timeline, and cut down to a short break when they would take up a quarter of it or more.
Ready to share: every page carries a title and a description for link previews, and with site_url and share_card a 1200×630 card with the repository’s numbers (rendered from share-card.html).
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.
Thanks to all contributors:
License
gitstats is licensed under the GNU General Public License, version 2 or version 3, at your option (GPL-2.0-only OR GPL-3.0-only), as the original gitstats was: see LICENSE-GPLv2 and LICENSE-GPLv3. The two JavaScript files bundled into the reports, Chart.js and sortable.js, keep their MIT license (see THIRD_PARTY_NOTICES.md).
The gitstats project was originally created by Heikki Hokkanen and is currently maintained by Xianpeng Shen.
Metadata
Release files for gitstats 2.12.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| gitstats-2.12.1.tar.gz | 599.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gitstats-2.12.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 877.9 kB
Release files / gitstats-2.12.1.tar.gz
| Download URL | gitstats-2.12.1.tar.gz |
|---|---|
| Size | 599.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ca1eb7333cf60bce066b6c851ec9fe9852a0b12d3825406c40f7202ccb1ff534
|
|
BLAKE2b-256 checksum How to use checksums |
d0ca8172bb47bda553048cad80a1c85580caf7b525ea5e464fb0dbd644306015
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|
Release files / gitstats-2.12.1-py3-none-any.whl
| Download URL | gitstats-2.12.1-py3-none-any.whl |
|---|---|
| Size | 278.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cb1e702e3ef7a77a8954d926e8f65c042a2990db5613a05009a3085a8965474f
|
|
BLAKE2b-256 checksum How to use checksums |
5ca2b5bb9103cab477b7627f313e827b462fc54856457f203176bc1b7d40b522
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|
Security for gitstats 2.12.1
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.