Skip to main content

A modular Python tool that aggregates and formats user-authored messages from repositories.

Project description

Git Recap

Git Recap is a modular Python tool that aggregates and formats user-authored messages from repositories hosted on GitHub, Azure DevOps, and GitLab. It fetches commit messages, pull requests (along with their associated commits), and issues, then consolidates and sorts these events into a clear, chronological summary. This summary is output as a plain text string that can serve as context for large language models or other analysis tools.

Features

  • Multi-Platform Support:
    Retrieve messages from:

  • Flexible Date Filtering:
    Specify start and end dates (automatically converted to UTC if no timezone info is provided) to restrict the range of events.

  • Author Filtering:
    Optionally specify one or more authors. By default, the authenticated user is used.

  • Output Schema:
    Each fetched event is stored in a standardized dictionary format with keys such as:

    • type (commit, commit_from_pr, pull_request, issue)
    • repo
    • message
    • timestamp
    • Additional keys like sha, pr_title, and pr_number for context
  • Chronological Aggregation:
    All events are merged and sorted in chronological order.
    A helper function then parses the JSON output into a plain text summary grouped by day, making it ideal as context for LLMs.

File Structure

git_recap/
├── README.md
├── requirements.txt
└── src
    ├── __init__.py
    ├── fetcher.py
    └── providers
         ├── __init__.py
         ├── base_fetcher.py
         ├── github_fetcher.py
         ├── azure_fetcher.py
         └── gitlab_fetcher.py
  • fetcher.py:
    Contains the main entry point which parses command-line arguments (provider, PAT, dates, repo filters, etc.) and invokes the appropriate provider fetcher.

  • providers/base_fetcher.py:
    Defines the abstract base class with common functionality such as date filtering and aggregating messages.

  • providers/github_fetcher.py:
    Implements GitHub-specific logic for fetching commits, pull requests (including their commits), and issues.

  • providers/azure_fetcher.py & providers/gitlab_fetcher.py:
    Implement similar logic for Azure DevOps and GitLab respectively.

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/git_recap.git
    cd git_recap
    
  2. Create a virtual environment (optional but recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows use: venv\Scripts\activate
    
  3. Install dependencies:

    pip install -r requirements.txt
    

Usage

Run the main script with the required parameters. For example:

GitHub

python src/fetcher.py --provider github --pat YOUR_GITHUB_PAT --start-date 2025-03-07T00:00:00 --end-date 2025-03-15T23:59:59 --repos Repo1 Repo2

Azure DevOps

python src/fetcher.py --provider azure --pat YOUR_AZURE_PAT --organization-url https://dev.azure.com/YOURORG --start-date 2025-03-07T00:00:00 --end-date 2025-03-15T23:59:59 --repos Repo1 Repo2

GitLab

python src/fetcher.py --provider gitlab --pat YOUR_GITLAB_PAT --gitlab-url https://gitlab.example.com --start-date 2025-03-07T00:00:00 --end-date 2025-03-15T23:59:59 --repos Repo1 Repo2

Contributing

Contributions are welcome! Please fork the repository and submit a pull request for any enhancements or bug fixes.

License

This project is licensed under the terms of the MIT License.

Acknowledgements

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

git_recap-0.1.1.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

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

git_recap-0.1.1-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file git_recap-0.1.1.tar.gz.

File metadata

  • Download URL: git_recap-0.1.1.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for git_recap-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a52ac7b644f0fafd80631eb5bc18c8283e8a5d4b40def200fcefb45ad5749e0f
MD5 660ad7d8e5b6a056e4d3148a5fa2035f
BLAKE2b-256 172ca95176199a8608e46577ff17b0cf09a291f857349d9f7726468929c2f4ba

See more details on using hashes here.

File details

Details for the file git_recap-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: git_recap-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for git_recap-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8acb17d7c22046154b010f288147c1af5b5a0338456b8d9ff7a916ac9d299789
MD5 18ea27d4ce4c66e1c93ba4d10ae23e9c
BLAKE2b-256 672e59bcbdfde45da9c9a9ec24781ac09123462c98324bbe659bfdd7909f9a60

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