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.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size jinja2-python-version-1.0.0.tar.gz (3.0 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for jinja2-python-version-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7c7ca58424f0f792f79ce91568ae81018add9e27673e82ddafebc3a38736e16 |
|
MD5 | a9f2e107e494c26232f5f37c6877118b |
|
BLAKE2-256 | c9b847d5851c3ec3e37991194a96d2103a7734eb2783842e778a1500485eb4dd |