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.0

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.0
File Size Uploaded Provenance Actions
githead-2.0.0.tar.gz 7.3 kB With provenance Details for githead-2.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 10.8 kB

Release files / githead-2.0.0.tar.gz

Download URL githead-2.0.0.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e9dec29d0f79e431e8c131bdcf1c5121b7ced18596baab638f149ee9a8b90d9d
BLAKE2b-256 checksum
How to use checksums
bdad26696e042a1f84d9e26dc33069a9cbf52c64092154a7e5a5f19ac735b824
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 Oct 27, 2026.

Transparency log

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

Download URL githead-2.0.0-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d98861e97ef2c4d68482bb3f2c7bc031fbb9883c0efd0ccdd47c2673e882b92e
BLAKE2b-256 checksum
How to use checksums
1abb2541ca635f161c1b168fd183377f17ee7d2604eb5848851841ac62440252
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 Oct 27, 2026.

Transparency log

Security for githead 2.0.0

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.0.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 Oct 27, 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