Generate comprehensive git information for your projects
Project description
git-json
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a20213171681a2abbdc007c5b9fa61d42a949dcc542054b18b95d3de9b3ed20e
|
|
| MD5 |
f915593748af3082e10c1cb16596a774
|
|
| BLAKE2b-256 |
743a2cb1f306df58db2a79d6d169d7b6b86e944b36d676d546a8c290dc8f7bbe
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb486c52b04e9afe8e6896d57f3238c11274ac8849477159c050fc60af2023ca
|
|
| MD5 |
c169bb8dd214e64c105b3a5c8a2d766a
|
|
| BLAKE2b-256 |
a99ebf803bab007e8581d0d2f9ee84a4abd9ad5b3b6465ceebcd008ac32d6b13
|