Skip to main content

Generate comprehensive git information for your projects

Project description

git-json

codecov PyPI version Python versions

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 configure default output paths in your pyproject.toml:

Single path:

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

Multiple paths (generates git.json in each location):

[tool.git-json]
path = ["src/resources", "dist/info", "build/metadata"]

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", "dist/info"]

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.1.tar.gz (6.7 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.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: git_json-1.0.1.tar.gz
  • Upload date:
  • Size: 6.7 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.1.tar.gz
Algorithm Hash digest
SHA256 a20213171681a2abbdc007c5b9fa61d42a949dcc542054b18b95d3de9b3ed20e
MD5 f915593748af3082e10c1cb16596a774
BLAKE2b-256 743a2cb1f306df58db2a79d6d169d7b6b86e944b36d676d546a8c290dc8f7bbe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: git_json-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eb486c52b04e9afe8e6896d57f3238c11274ac8849477159c050fc60af2023ca
MD5 c169bb8dd214e64c105b3a5c8a2d766a
BLAKE2b-256 a99ebf803bab007e8581d0d2f9ee84a4abd9ad5b3b6465ceebcd008ac32d6b13

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