Skip to main content

Jinja2 extension to handle git-specific things

Project description

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

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

jinja2-git-1.2.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

jinja2_git-1.2.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file jinja2-git-1.2.0.tar.gz.

File metadata

  • Download URL: jinja2-git-1.2.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.8.9 Darwin/18.7.0

File hashes

Hashes for jinja2-git-1.2.0.tar.gz
Algorithm Hash digest
SHA256 df47e7ec0dd3ca937a3f18dac4fd69eaf16675b6f63c5c95969650a02f24e639
MD5 561699ae4770578558c218e9536b7dc7
BLAKE2b-256 a21f3cfcd5cd257d7520a91f2f80f0e50a34ca89eae3621fdb146fc9c24a7d8e

See more details on using hashes here.

File details

Details for the file jinja2_git-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: jinja2_git-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.8.9 Darwin/18.7.0

File hashes

Hashes for jinja2_git-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b11b45ae2e8e8e3f622ef444523b3d856b3af150fa443a4ae6adeb47dfd2024
MD5 af5948729b53b62b03c700e7eac58f82
BLAKE2b-256 3a061123613bb2d9df64e8aefa4e3095b9db87b9a0d258dd1e1df48c53feecd4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page