Skip to main content

Generate git metadata JSON files

Project description

git-metainfo

Generate git metadata JSON

Output git metadata:

By default, author and committer names and emails are omitted:

$ git-metainfo
{
  "hash": "40b71138b4ef89496645e377008e11eedbe207d6",
  "short_hash": "40b7113",
  "author_date": "2026-05-08 22:06:47 -0700",
  "author_date_iso": "2026-05-08T22:06:47-07:00",
  "committer_date": "2026-05-08 22:06:47 -0700",
  "committer_date_iso": "2026-05-08T22:06:47-07:00",
  "message": "Code",
  "branch": "master",
  "detached_head": false
}

Include names and emails with --include-identity:

$ git-metainfo --include-identity
{
  "hash": "40b71138b4ef89496645e377008e11eedbe207d6",
  "short_hash": "40b7113",
  "author_name": "John Doe",
  "author_email": "john@doe.com",
  "author_date": "2026-05-08 22:06:47 -0700",
  "author_date_iso": "2026-05-08T22:06:47-07:00",
  "committer_name": "John Doe",
  "committer_email": "john@doe.com",
  "committer_date": "2026-05-08 22:06:47 -0700",
  "committer_date_iso": "2026-05-08T22:06:47-07:00",
  "message": "Code",
  "branch": "master",
  "detached_head": false
}

Output to a file:

git-metainfo --output file.json

Use as library:

from git_metainfo.core import get_git_data

data = get_git_data()

# Include author and committer names and emails
data = get_git_data(include_identity=True)

Development

Install

poetry install

Install pre-commit

pre-commit install

Format

ruff format && isort .

See also:

Typescript version

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_metainfo_python-0.1.3.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

git_metainfo_python-0.1.3-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file git_metainfo_python-0.1.3.tar.gz.

File metadata

  • Download URL: git_metainfo_python-0.1.3.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.10.14 Darwin/25.5.0

File hashes

Hashes for git_metainfo_python-0.1.3.tar.gz
Algorithm Hash digest
SHA256 d4d308a5ce9078a0561bec106f90d46410026b921c39da7c23438d8d57aa2b93
MD5 d7d0e90c7c427229370a173d366b5996
BLAKE2b-256 837c6e98f0db6664e87ea43d697e7004a6c706c25ddd7a1b448518f3da1fae62

See more details on using hashes here.

File details

Details for the file git_metainfo_python-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for git_metainfo_python-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d60e312ae2236b8d6b5431dabfb99399e610676616230d2a9ad89487829be8f5
MD5 a5fa406ba6f7fa874780f8d9732ca382
BLAKE2b-256 87d1ca75a8ddccc447eb6e0ba65cca1c977df0c4c99e13c1222ad73e74119373

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