Skip to main content

Cross-platform Git history access via Rust with a Python API

Project description

PyGitX icon

pypi coverage support-version license build commit

Cross-platform Git history access implemented in Rust with a Python API via PyO3 and libgit2.

Highlights

  • Fast Git history access via libgit2 with a lightweight Python wrapper.
  • Repo helpers for HEAD info, revision parsing, commit listing, and branch/tag lookup.
  • History rewriting tools: amend messages, rewrite author/committer, reword arbitrary commits, squash, rebase (pick-only), drop commits, and purge paths.
  • All rewrites return a RewriteResult with mappings and ref updates.

Install

pip install pygitx

Python usage

import pygitx
from pathlib import Path

repo = pygitx.open_repo(Path("."))
head = repo.head()
print("HEAD:", head.id if head else "None")

# Resolve a revision (branch/tag/oid) to a hex id
print("main ->", repo.rev_parse("main"))

for c in repo.list_commits(max=5):
    print(f"{c.id[:7]} {c.author} <{c.email}> {c.summary}")

Example script: examples/demo.py (run with --help to see options).

Documentation

Full API and usage docs live in docs/ (Sphinx). Build locally with:

make docs

Or browse the published docs if available in your environment.

Development

  • Tests without Python runtime: cargo test
  • Python-facing tests: cargo test --features python-tests
  • Make targets: make venv, make install, make develop, make release, make docs, make test

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

pygitx-0.1.2-cp39-abi3-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.9+Windows x86-64

pygitx-0.1.2-cp39-abi3-manylinux_2_34_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.34+ x86-64

pygitx-0.1.2-cp39-abi3-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

Details for the file pygitx-0.1.2-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: pygitx-0.1.2-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pygitx-0.1.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a5ede4126728b2d0c045d3aad64d689e6944c0a955705b7877c2b519f5532244
MD5 46e70c71c97832b3f1d1b4af3412b34e
BLAKE2b-256 cbd57a4ceb59583dadfc95d3b8e5916b3220182b52e67ff6972d417f32b38985

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygitx-0.1.2-cp39-abi3-win_amd64.whl:

Publisher: publish-to-pypi.yml on zangjiucheng/pygitx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygitx-0.1.2-cp39-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pygitx-0.1.2-cp39-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 fb690705d2bd35eb3faae26ef4bb114e15b79954e5365ea520e9b74cc4b48b8a
MD5 80524f45bbf475f12df26322de1cd794
BLAKE2b-256 379bea97ca0c3ae3a38739adc0c5d90a9ee6c757bcb2f2317e7fb5190c9f1dd6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygitx-0.1.2-cp39-abi3-manylinux_2_34_x86_64.whl:

Publisher: publish-to-pypi.yml on zangjiucheng/pygitx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygitx-0.1.2-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pygitx-0.1.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 899c20fc4f244c16e7ef1bdaa8c0aa08dc90a6424acb0ff851d3ea7febb850ed
MD5 fce4e53188ef011ed483aa84caaaee64
BLAKE2b-256 63adddbc349c6cfc59911f9bf784ac597558dfe7fa267b75151edc826ad1b46d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygitx-0.1.2-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: publish-to-pypi.yml on zangjiucheng/pygitx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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