Skip to main content

Generate comprehensive git information for your projects

Project description

git-json

codecov PyPI - Version

A Python tool to generate comprehensive git information for your projects.

Installation

pip install git-json

Usage

Command Line

# Generate git info to default 'resources' directory
git-json

# Generate git info to custom directory
git-json --package-path my-resources

Python API

from git_json import GitJsonGenerator

generator = GitJsonGenerator()
generator.generate_git_json("output-directory")

Configuration

You can set a default output path in your pyproject.toml:

[tool.git-json]
path = "my-custom-path"

This is useful when using git-json as a poetry script:

[tool.poetry.scripts]
git-json = "git_json.cli:main"

[tool.git-json]
path = "src/resources"

Output

Generates a git.json file with comprehensive git information including:

  • Branch information
  • Commit details (hash, message, author, time)
  • Build information (host, time, user)
  • Repository status (dirty, ahead/behind)
  • Tags and version information

Development

# Install dependencies
poetry install --with dev

# Run tests
poetry run pytest

# Run linting
poetry run ruff check .

# Generate git info
poetry run git-json

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_json-1.0.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

git_json-1.0.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file git_json-1.0.0.tar.gz.

File metadata

  • Download URL: git_json-1.0.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.11 Linux/6.11.0-1018-azure

File hashes

Hashes for git_json-1.0.0.tar.gz
Algorithm Hash digest
SHA256 54857041a75e09dd8879c76b243d499ab41eca044442bde7fe4ca2b2861f969a
MD5 3186adea1fd984a1e3679541c910e34c
BLAKE2b-256 25f4e72be2adc639a730a219920dc56ae15f694e0ef762ec19b561bcdbac5c04

See more details on using hashes here.

File details

Details for the file git_json-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: git_json-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.11 Linux/6.11.0-1018-azure

File hashes

Hashes for git_json-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 96462981b695f52dbb0fbf6741c808c97569602c91753bc32dbf3d5382596023
MD5 152c8bc858290431fbe83dae0383d899
BLAKE2b-256 a9421b3beaa78bbde17d8bc70a2671db5264c43933dee90fefe75a9d1b780f65

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