Skip to content

v1.0.0

Choose a tag to compare

@carefree666 carefree666 released this 31 Oct 07:50
· 1 commit to main since this release

GitLab Stats v1.0.0 – 2025-10-31

Overview

First stable release of GitLab Stats, a Python-based tool to collect GitLab commit statistics and export results in CSV format.
Also provides a Web API for querying statistics and downloading CSV reports.

Features

  • CLI support: Generate CSV reports from terminal.
  • Web API support: Start a FastAPI server to query statistics.
  • Configurable users: Collect stats for specific GitLab usernames.
  • Date range filtering: Specify start_date and end_date.
  • Maximum lines per commit: Limit counted additions/deletions per commit (max_lines_per_commit in config, default 1000).
  • Friendly error handling: Empty or invalid user lists are reported clearly.
  • Docker support: Build and run container images.
  • Makefile support: Run, package, and build Docker images easily.

CLI Usage

make run
  • Generates CSV output (gitlab_code_stats.csv by default).
  • Configurable via config.json.

Web API Usage

make web
{
  "start_date": "2025-10-01T00:00:00Z",
  "end_date": "2025-10-31T23:59:59Z",
  "users": ["zhangsan"]
}
  • Example CSV response fields:
    Username, Name, CommitCount, TotalLines, Additions, Deletions

Docker Usage

Build and run Docker image:

make docker-build

Or manually:

docker build -t gitlab-stats .
docker run -v $(pwd)/config.json:/app/config.json gitlab-stats
  • Multi-arch supported: linux/amd64, linux/arm64.

Packaging

Create source tar.gz package:

make package

Configuration

Example config.json:

{
  "api_url": "https://gitlab.example.com/api/v4",
  "private_token": "YOUR_TOKEN_HERE",
  "start_date": "2025-10-01T00:00:00Z",
  "end_date": "2025-10-31T23:59:59Z",
  "users": ["zhangsan"],
  "output_filename": "gitlab_code_stats.csv",
  "max_lines_per_commit": 1000
}

Known Issues

  • Only supports GitLab REST API v4.
  • Fetching commits for very large repositories may be slow.

Future Improvements

  • Optimize pagination for massive commit histories.
  • Support self-hosted GitLab instances with custom SSL certificates.
  • Web UI dashboard for visualization.

Full Changelog: https://github.com/carefree666/gitlab-code-stats/commits/v1.0.0