Skip to main content

githead

PyPI - Python Version

Read a checkout's Git HEAD from Python without launching Git. Python 3.11+.

Installation

pip install githead

Read a checkout's HEAD

Run from a checkout with a .git directory and a loose HEAD reference:

from githead import githead

print(githead())

githead reference

githead(git_dir=".git") accepts the metadata directory, not the working-tree root. It returns the stripped contents of a detached HEAD or its loose reference file.

This is a small file reader, not a general Git interface: packed refs, reftable, unborn branches, and .git files used by worktrees or submodules are unsupported. Missing files raise FileNotFoundError; references outside git_dir raise ValueError. Other file-reading errors propagate.

Full reference · Issues and questions · Private security reports · Premium support

Metadata

Release files for githead 2.0.1

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

Source distribution (sdist)

Source distribution for githead 2.0.1
File Size Uploaded Provenance Actions
githead-2.0.1.tar.gz 7.3 kB With provenance Details for githead-2.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 10.8 kB

Release files / githead-2.0.1.tar.gz

Download URL githead-2.0.1.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7e0e1c484ea049217162a605b952dab56a5170f484077957baf4f5489d2a5ef4
BLAKE2b-256 checksum
How to use checksums
15f7b0924b293b1a2dfb2c20a18564a7ca17f8a5f517b8b88ad5db6ffe38e3c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / githead-2.0.1-py3-none-any.whl

Download URL githead-2.0.1-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e10641efad3b9d1c45a426cbfe655bff1ff553448ecdfe85216027260c4dc13
BLAKE2b-256 checksum
How to use checksums
0964e0d1f7c7853414c2f1ccc568e7a6977248c818bbbfbbf295d27be28cd5e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for githead 2.0.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for githead-2.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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