This project is a Python script that collects and aggregates Git statistics from local repositories and generates a visually appealing card summarizing global stats as an image.
- Recursively scans a directory for all Git repositories.
- Collects commit statistics for a specific year (default: 2024).
- Aggregates global stats, including:
- Total number of commits.
- Most active month.
- Most active day of the week.
- Top programming language based on file extensions.
- Generates a single card-style image summarizing the global stats.
A single card is generated as an image with the following details:
- Total Commits: The aggregate number of commits across all repositories.
- Most Active Month: The month with the highest commits.
- Most Active Day: The most active day of the week for commits.
- Top Language: The most commonly used file extension.
- Python 3.7+
- Pillow (Python Imaging Library)
- Clone this repository or download the script.
- Install dependencies:
pip install pillow
- Place all your repositories in a single directory (e.g.,
/path/to/your/repos
). - Update the
ROOT_DIR
constant in the script to the path of your repositories directory:ROOT_DIR = "/path/to/your/repos"
- Update the font path (
FONT_PATH
) in the script to a font available on your system (e.g., DejaVu Sans on Linux):FONT_PATH = "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf"
- Run the script:
python script_name.py
- The global statistics will be displayed in the terminal.
- A card image summarizing the global stats will be saved as
global_stats.png
in the current directory.
Global Stats:
Total Commits: 1234
Most Active Month: July
Most Active Day: Tuesday
Top Language: .py
- Year: Change the year for which stats are collected by modifying the
YEAR
constant:YEAR = 2024
- Card Design: Modify dimensions, colors, and fonts by editing the
CARD_WIDTH
,CARD_HEIGHT
,BACKGROUND_COLOR
, and related constants.
This project is licensed under the MIT License. See the LICENSE file for details.