jinja2-git


Namejinja2-git JSON
Version 1.4.0 PyPI version JSON
download
home_pagehttps://github.com/wemake-services/jinja2-git
SummaryJinja2 extension to handle git-specific things
upload_time2024-06-27 17:15:14
maintainerNone
docs_urlNone
authorNikita Sobolev
requires_python<4.0,>=3.9
licenseMIT
keywords jinja2 jinja2-extension jinja2-plugin git
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Jinja2 extension to handle git-specific things

[![wemake.services](https://img.shields.io/badge/%20-wemake.services-green.svg?label=%20&logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC%2FxhBQAAAAFzUkdCAK7OHOkAAAAbUExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP%2F%2F%2F5TvxDIAAAAIdFJOUwAjRA8xXANAL%2Bv0SAAAADNJREFUGNNjYCAIOJjRBdBFWMkVQeGzcHAwksJnAPPZGOGAASzPzAEHEGVsLExQwE7YswCb7AFZSF3bbAAAAABJRU5ErkJggg%3D%3D)](https://wemake.services)
[![test](https://github.com/wemake-services/jinja2-git/actions/workflows/test.yml/badge.svg?branch=master&event=push)](https://github.com/wemake-services/jinja2-git/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/wemake-services/jinja2-git/branch/master/graph/badge.svg)](https://codecov.io/gh/wemake-services/jinja2-git)
[![Python versions](https://img.shields.io/pypi/pyversions/jinja2-git.svg)](https://pypi.python.org/pypi/jinja2-git)
[![wemake-python-styleguide](https://img.shields.io/badge/style-wemake-000000.svg)](https://github.com/wemake-services/wemake-python-styleguide)


## Installation

```bash
$ 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 `cookiecutter`:

- [wemake-django-template](https://github.com/wemake-services/wemake-django-template)
- [wemake-vue-template](https://github.com/wemake-services/wemake-vue-template)


## Usage

Add it as an extension for
[jinja2](http://jinja.pocoo.org/docs/2.10/extensions/) or
[cookiecutter](http://cookiecutter.readthedocs.io/en/latest/advanced/template_extensions.html).

And then inside a template:

```python
from jinja2 import Environment

env = Environment(extensions=['jinja2_git.GitExtension'])
template = env.from_string('Commit is: {% gitcommit %}')
# => Commit is: c644682f4899d7e98147ce3a61a11bb13c52b3a0
```

Or short version:

```python
from jinja2 import Environment

env = Environment(extensions=['jinja2_git.GitExtension'])
template = env.from_string('Commit is: {% gitcommit short=True %}')
# => Commit is: c644682
```


## License

[MIT](https://github.com/wemake-services/jinja2-git/blob/master/LICENSE)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/wemake-services/jinja2-git",
    "name": "jinja2-git",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "jinja2, jinja2-extension, jinja2-plugin, git",
    "author": "Nikita Sobolev",
    "author_email": "mail@sobolenv.me",
    "download_url": "https://files.pythonhosted.org/packages/ee/c6/81e4fa3eb13cf497235ad241f6b7879ab64eb96dbf641de914ff5ecd8ed8/jinja2_git-1.4.0.tar.gz",
    "platform": null,
    "description": "# Jinja2 extension to handle git-specific things\n\n[![wemake.services](https://img.shields.io/badge/%20-wemake.services-green.svg?label=%20&logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC%2FxhBQAAAAFzUkdCAK7OHOkAAAAbUExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP%2F%2F%2F5TvxDIAAAAIdFJOUwAjRA8xXANAL%2Bv0SAAAADNJREFUGNNjYCAIOJjRBdBFWMkVQeGzcHAwksJnAPPZGOGAASzPzAEHEGVsLExQwE7YswCb7AFZSF3bbAAAAABJRU5ErkJggg%3D%3D)](https://wemake.services)\n[![test](https://github.com/wemake-services/jinja2-git/actions/workflows/test.yml/badge.svg?branch=master&event=push)](https://github.com/wemake-services/jinja2-git/actions/workflows/test.yml)\n[![codecov](https://codecov.io/gh/wemake-services/jinja2-git/branch/master/graph/badge.svg)](https://codecov.io/gh/wemake-services/jinja2-git)\n[![Python versions](https://img.shields.io/pypi/pyversions/jinja2-git.svg)](https://pypi.python.org/pypi/jinja2-git)\n[![wemake-python-styleguide](https://img.shields.io/badge/style-wemake-000000.svg)](https://github.com/wemake-services/wemake-python-styleguide)\n\n\n## Installation\n\n```bash\n$ pip install jinja2-git\n```\n\n\n## Reasoning\n\nThis plugin is used to render commit hash in `jinja2` templates. We are\nusing it to render our template version in `cookiecutter`:\n\n- [wemake-django-template](https://github.com/wemake-services/wemake-django-template)\n- [wemake-vue-template](https://github.com/wemake-services/wemake-vue-template)\n\n\n## Usage\n\nAdd it as an extension for\n[jinja2](http://jinja.pocoo.org/docs/2.10/extensions/) or\n[cookiecutter](http://cookiecutter.readthedocs.io/en/latest/advanced/template_extensions.html).\n\nAnd then inside a template:\n\n```python\nfrom jinja2 import Environment\n\nenv = Environment(extensions=['jinja2_git.GitExtension'])\ntemplate = env.from_string('Commit is: {% gitcommit %}')\n# => Commit is: c644682f4899d7e98147ce3a61a11bb13c52b3a0\n```\n\nOr short version:\n\n```python\nfrom jinja2 import Environment\n\nenv = Environment(extensions=['jinja2_git.GitExtension'])\ntemplate = env.from_string('Commit is: {% gitcommit short=True %}')\n# => Commit is: c644682\n```\n\n\n## License\n\n[MIT](https://github.com/wemake-services/jinja2-git/blob/master/LICENSE)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Jinja2 extension to handle git-specific things",
    "version": "1.4.0",
    "project_urls": {
        "Funding": "https://github.com/sponsors/wemake-services",
        "Homepage": "https://github.com/wemake-services/jinja2-git",
        "Repository": "https://github.com/wemake-services/jinja2-git"
    },
    "split_keywords": [
        "jinja2",
        " jinja2-extension",
        " jinja2-plugin",
        " git"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "803d6ea7c9a41e9f3d88c5e0675ca35456abf23b34e2ea6f1650731ad7a73d09",
                "md5": "b4cb304e1341e289303bd50a16e2ad70",
                "sha256": "149163fabe1dbf98cdb0adb0fea0f33d98bc4323432ab346082966479422e8b5"
            },
            "downloads": -1,
            "filename": "jinja2_git-1.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b4cb304e1341e289303bd50a16e2ad70",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 3484,
            "upload_time": "2024-06-27T17:14:14",
            "upload_time_iso_8601": "2024-06-27T17:14:14.116736Z",
            "url": "https://files.pythonhosted.org/packages/80/3d/6ea7c9a41e9f3d88c5e0675ca35456abf23b34e2ea6f1650731ad7a73d09/jinja2_git-1.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "eec681e4fa3eb13cf497235ad241f6b7879ab64eb96dbf641de914ff5ecd8ed8",
                "md5": "805f748f790e654611ab5dd25f5c29e5",
                "sha256": "7f0fbe896fc5116276b8a47dfc8bc52fd5e9f5ee54deee71dcb7986b03cf7973"
            },
            "downloads": -1,
            "filename": "jinja2_git-1.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "805f748f790e654611ab5dd25f5c29e5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 3205,
            "upload_time": "2024-06-27T17:15:14",
            "upload_time_iso_8601": "2024-06-27T17:15:14.697173Z",
            "url": "https://files.pythonhosted.org/packages/ee/c6/81e4fa3eb13cf497235ad241f6b7879ab64eb96dbf641de914ff5ecd8ed8/jinja2_git-1.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-27 17:15:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "wemake-services",
    "github_project": "jinja2-git",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "jinja2-git"
}
        
Elapsed time: 0.85109s