v1.0.0
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_dateandend_date. - Maximum lines per commit: Limit counted additions/deletions per commit (
max_lines_per_commitin 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.csvby default). - Configurable via
config.json.
Web API Usage
make web- Swagger docs: http://localhost:8000/docs
- POST
/statswith JSON body:
{
"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-buildOr 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 packageConfiguration
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