Jinja2 extension to handle git-specific things
Installation
$ pip install jinja2-git
Reasoning
This plugin is used to render commit hash in jinja2 templates. We are
using it to render our template version in cookiecutter:
Usage
Add it as an extension for jinja2 or cookiecutter.
And then inside a template:
from jinja2 import Environment
env = Environment(extensions=['jinja2_git.GitExtension'])
template = env.from_string('Commit is: {% gitcommit %}')
# => Commit is: c644682f4899d7e98147ce3a61a11bb13c52b3a0
Or short version:
from jinja2 import Environment
env = Environment(extensions=['jinja2_git.GitExtension'])
template = env.from_string('Commit is: {% gitcommit short=True %}')
# => Commit is: c644682
License
Metadata
Release files for jinja2-git 1.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jinja2_git-1.4.0.tar.gz | 3.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jinja2_git-1.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.7 kB
Release files / jinja2_git-1.4.0.tar.gz
| Download URL | jinja2_git-1.4.0.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f0fbe896fc5116276b8a47dfc8bc52fd5e9f5ee54deee71dcb7986b03cf7973
|
|
BLAKE2b-256 checksum How to use checksums |
eec681e4fa3eb13cf497235ad241f6b7879ab64eb96dbf641de914ff5ecd8ed8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.11.5 Darwin/23.5.0
|
Release files / jinja2_git-1.4.0-py3-none-any.whl
| Download URL | jinja2_git-1.4.0-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
149163fabe1dbf98cdb0adb0fea0f33d98bc4323432ab346082966479422e8b5
|
|
BLAKE2b-256 checksum How to use checksums |
803d6ea7c9a41e9f3d88c5e0675ca35456abf23b34e2ea6f1650731ad7a73d09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.11.5 Darwin/23.5.0
|