=====================
Jinja2 Python Version
=====================
.. image:: https://badge.fury.io/py/jinja2-python-version.svg
:target: https://badge.fury.io/py/jinja2-python-version
.. image:: https://app.travis-ci.com/jmfederico/jinja2-python-version.svg?branch=master
:target: https://app.travis-ci.com/jmfederico/jinja2-python-version
A Jinja extension that creates a global variable with Python version
information for your Jinja2 templates:
Compatible with Jinja2 versions 2.x and 3.x.
Usage
-----
.. code-block:: console
$ pip install jinja2-python-version
.. code-block:: python
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 }}")
template.render()
Raw data
{
"_id": null,
"home_page": "https://github.com/jmfederico/jinja2-python-version",
"name": "jinja2-python-version",
"maintainer": "",
"docs_url": null,
"requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
"maintainer_email": "",
"keywords": "jinja2,jinja3,extension,python,versions",
"author": "Federico Jaramillo Mart\u00ednez",
"author_email": "federicojaramillom@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/eb/cf/3829ef29d5d3a8bf86c93be871706f394927243b621b50ef68fa638aa732/jinja2_python_version-1.2.0.tar.gz",
"platform": null,
"description": "=====================\nJinja2 Python Version\n=====================\n\n.. image:: https://badge.fury.io/py/jinja2-python-version.svg\n :target: https://badge.fury.io/py/jinja2-python-version\n\n.. image:: https://app.travis-ci.com/jmfederico/jinja2-python-version.svg?branch=master\n :target: https://app.travis-ci.com/jmfederico/jinja2-python-version\n\nA Jinja extension that creates a global variable with Python version\ninformation for your Jinja2 templates:\n\nCompatible with Jinja2 versions 2.x and 3.x.\n\nUsage\n-----\n.. code-block:: console\n\n $ pip install jinja2-python-version\n\n.. code-block:: python\n\n from jinja2 import Environment\n\n env = Environment(extensions=['jinja2_python_version.PythonVersionExtension'])\n\n # 3.6\n template = env.from_string(\"{{ python_version }}\")\n\n # 3.6\n template = env.from_string(\"{{ python_version.minor }}\")\n\n # 3\n template = env.from_string(\"{{ python_version.major }}\")\n\n # 3.6.4\n template = env.from_string(\"{{ python_version.micro }}\")\n\n template.render()\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "A Jinja2 extension that adds python version to templates.",
"version": "1.2.0",
"split_keywords": [
"jinja2",
"jinja3",
"extension",
"python",
"versions"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6be7fe284c3e3de2001ef52dd1e2ead2d89c2506c0f4d4b198c3a8bbe61df7ba",
"md5": "fbd6a727cd8ed5e3da393e883315ef3c",
"sha256": "4c9e251c7d42c8220d512f1f575373a8e521e97f7c8409e1f7a33af07a33f478"
},
"downloads": -1,
"filename": "jinja2_python_version-1.2.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "fbd6a727cd8ed5e3da393e883315ef3c",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
"size": 3399,
"upload_time": "2023-01-27T10:19:06",
"upload_time_iso_8601": "2023-01-27T10:19:06.494064Z",
"url": "https://files.pythonhosted.org/packages/6b/e7/fe284c3e3de2001ef52dd1e2ead2d89c2506c0f4d4b198c3a8bbe61df7ba/jinja2_python_version-1.2.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ebcf3829ef29d5d3a8bf86c93be871706f394927243b621b50ef68fa638aa732",
"md5": "5b488140121dab9c1ea6a2923fb783ae",
"sha256": "b2cd7da29f32763e61dfe853185e011e8b4fd6dcd1b4fa8d74f7657722c6a28e"
},
"downloads": -1,
"filename": "jinja2_python_version-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "5b488140121dab9c1ea6a2923fb783ae",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
"size": 2981,
"upload_time": "2023-01-27T10:19:08",
"upload_time_iso_8601": "2023-01-27T10:19:08.272901Z",
"url": "https://files.pythonhosted.org/packages/eb/cf/3829ef29d5d3a8bf86c93be871706f394927243b621b50ef68fa638aa732/jinja2_python_version-1.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-27 10:19:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "jmfederico",
"github_project": "jinja2-python-version",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "jinja2-python-version"
}