Skip to main content

A tool to analyze Git commits and generate articles.

Project description

Git Commit Article Generator (Standalone Python)

This Python script is a command-line tool designed to help you generate a blog article summarizing recent Git commits from one or more repositories, specifically filtering for commits made by your company. It supports both manual input and configuration via an INI file.

Project Structure

git-analyzer/
├── amarula/                # Examples of configuration file from our organization
├── src/
│   ├── __init__.py         # Makes 'src' a Python package   ├── git_utils.py        # Contains functions for Git operations (clone, pull, analyze commits)   ├── article_generator.py # Contains logic for generating the article content   ├── config_parser.py    # Handles loading configuration from INI files
├── main.py                 # The main entry point of the application
├── pyproject.toml          # Project metadata and dependencies (modern Python packaging)
├── requirements.txt        # List of direct Python dependencies
├── README.md               # This file
├── .gitignore              # Specifies intentionally untracked files to ignore

Dependencies

This project relies on the following key libraries:

  • gitpython

Use requirements.txt to install it if needed.

pip install -r requirements.txt

Features

  • Real Git Operations: Clones specified Git repositories and analyzes their commit history.

  • Company-Specific Filtering: Identifies commits made by a specified company identifier (e.g., email domain or author name).

  • Time-Based Analysis: Filters commits within a configurable number of past months.

  • Multi-Repository Support: Processes multiple Git repositories in a single run.

  • Article Generation: Generates a summary article based on the analyzed commits.

  • INI File Configuration (Optional): Allows you to configure repository URLs, company identifier, and months to analyze using an INI file, making repeated runs easier.

  • Output to Console & File: Prints the generated article to the console and offers to save it to a Markdown file.

Prerequisites

Before running this tool, ensure you have the following installed on your system:

  • Python 3.x: The script is written in Python 3. You can download it from python.org.

  • Git: The command-line Git client must be installed and accessible in your system's PATH. You can download Git from git-scm.com.

How to Use

1. Save the Script

Save the provided Python code as a .py file (e.g., git_analyzer.py).

2. (Optional) Create an INI Configuration File

For easier repeated use, you can create a configuration file named config.ini (or any other name you prefer) in the same directory as your Python script.

Example config.ini:

[GitConfig]
repo_urls = [https://github.com/torvalds/linux.git,https://github.com/kubernetes/kubernetes.git](https://github.com/torvalds/linux.git,https://github.com/kubernetes/kubernetes.git)
company_identifier = @linux.com # Or a name like 'Linus Torvalds'
months_back = 12

3. Execute the tool

The easy way to run it is to configure in a ini file and then run the tool.

python main.py -f amarula/config.ini -s report.md

TODO

  • Create a tool to post on social media like linkedin, X and facebook

Project details


Download files

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

Source Distribution

gitscribeai-0.1.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

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

gitscribeai-0.1.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file gitscribeai-0.1.0.tar.gz.

File metadata

  • Download URL: gitscribeai-0.1.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gitscribeai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d70ca4e56d4a676e6b1942ad692f4ff850e6064e426bde0bdcaf34427f9dcd5a
MD5 d23b6423ae4a2e91aa485d6de2914853
BLAKE2b-256 bf7dc2bc602bb131c5aa0ae7658ec475d9b7fba564daee95292109037e903020

See more details on using hashes here.

File details

Details for the file gitscribeai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gitscribeai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gitscribeai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94de8f1575d14e650739a03b27e9431811f204b25ecdc9f47437d3477b3a472d
MD5 f6b979810fae6468ddaeebaed1839139
BLAKE2b-256 a3e8f45dfb8989c6554c6430d48e2dbd546c9971aa34e8c0dcc85f861d66004c

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 Pingdom Monitoring Sentry Error logging StatusPage Status page