A Jinja2 extenstion that adds python version to templates.
Project description
A Jinja extenstion that creates a global variable with Python version information for your Jinja2 templates:
Usage
$ pip install jinja2-python-version
from jinja2 import Environment
env = Environment(extensions=['jinja2_python_version.PythonVersionExtension'])
# 3.6
template = env.from_string("{{ python_version }}")
# 3.6
template = env.from_string("{{ python_version.minor }}")
# 3
template = env.from_string("{{ python_version.major }}")
# 3.6.4
template = env.from_string("{{ python_version.micro }}")
# ('3', '6', '4')
template = env.from_string("{{ python_version.tuple }}")
template.render()
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
Close
Hashes for jinja2-python-version-1.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | be2defa330613ba413eb702405d89e9ea576a3b1ea53bfaeb87347a4832debfe |
|
MD5 | 44648619ee2c0e93e5554818e0363ac4 |
|
BLAKE2b-256 | d580a3d553de6a204f7b013072c2375534582cb0e572ba56bc70de767ebfcbed |