Skip to main content

Jinja2 extension to handle git-specific things

wemake.services test codecov Python versions wemake-python-styleguide

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 cookicutter:

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

MIT

Metadata

Release files for jinja2-git 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jinja2-git 1.2.0
File Size Uploaded
jinja2-git-1.2.0.tar.gz 3.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jinja2-git 1.2.0
File Interpreter ABI Platform
jinja2_git-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 kB

Release files / jinja2-git-1.2.0.tar.gz

Download URL jinja2-git-1.2.0.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
df47e7ec0dd3ca937a3f18dac4fd69eaf16675b6f63c5c95969650a02f24e639
BLAKE2b-256 checksum
How to use checksums
a21f3cfcd5cd257d7520a91f2f80f0e50a34ca89eae3621fdb146fc9c24a7d8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.14 CPython/3.8.9 Darwin/18.7.0

Release files / jinja2_git-1.2.0-py3-none-any.whl

Download URL jinja2_git-1.2.0-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b11b45ae2e8e8e3f622ef444523b3d856b3af150fa443a4ae6adeb47dfd2024
BLAKE2b-256 checksum
How to use checksums
3a061123613bb2d9df64e8aefa4e3095b9db87b9a0d258dd1e1df48c53feecd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.14 CPython/3.8.9 Darwin/18.7.0

Release history Release notifications | RSS feed

1.4.0

2 release files

1.3.0

2 release files

This release

1.2.0 This release

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.2.0

2 release files

0.1.0

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page