Skip to main content

parsegitlog

python -m pip install parsegitlog

Context

I've been working on a project where I need to get information on every commit from serveral hundred repos, and using GitPython. GitPython is great, but it was a little slow for what I was trying to do.

The method of parsing the gitlog in this project is much faster for my use case.

Note that this project is much more narrow in scope than GitPython, and relies on parsing the output of git log directly, so might be more fragile.

You might find this useful if you only need to analyze the commits for a repo, and not perform any other git operations progromatically.

Usage

You can either import this as a module or run it from the command line.

Command Line

python -m parsegitlog --help
python -m parsegitlog

Importing

from parsegitlog import get_commits

repo_path = '/path/to/my/git/repository'

get_commits(repo_path)

get_commits will return a list of dicts, each dict representing a single commit from the repository.

Gotchas

Merge commits will show up multiple times. This is intended behavior.

Although they appear to be duplicates, the files_changed, insertions, and deletions for each will be slightly different, and there will be duplicate entries for each merge commit corresponding to the number of parents in the merge. This is because, depending on which parent we compare to, the difference from the parent (in terms of files changed, insertions, and deletions) won't be the same (every other property should be the same).

Metadata

Release files for parsegitlog 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for parsegitlog 0.0.3
File Size Uploaded Provenance
parsegitlog-0.0.3.tar.gz 5.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for parsegitlog 0.0.3
File Interpreter ABI Platform
parsegitlog-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 10.5 kB

Release files / parsegitlog-0.0.3.tar.gz

Download URL parsegitlog-0.0.3.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1f88c598328b6f00a001bcafd991c0345f756f42bb35b234372127de64d6c881
BLAKE2b-256 checksum
How to use checksums
3d880d522caaf4af82e1e28e71c509091561dcd59b4e446d87873fcafc6f29b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Release files / parsegitlog-0.0.3-py3-none-any.whl

Download URL parsegitlog-0.0.3-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9edcd984228c39597884ac2614fb52ee87f428bf17a4d9f72864c96a0362b5ea
BLAKE2b-256 checksum
How to use checksums
e635da327c791c59b5a63a9960bf72b6e5f03c96cd58044bac9138d72bf8e50f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Security for parsegitlog 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page