jinja2-cli-1.0.0b1
توضیحات
The CLI interface to Jinja2
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | jinja2-cli-1.0.0b1 |
| نام | jinja2-cli |
| نسخه کتابخانه | 1.0.0b1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Matt Robenolt |
| ایمیل نویسنده | Matt Robenolt <m@robenolt.com> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/jinja2-cli/ |
| مجوز | Copyright (c) 2017-2026, Matt Robenolt All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
# $ jinja2
The CLI for [Jinja2](https://jinja.palletsprojects.com/).
```
$ jinja2 template.j2 data.json
$ curl -s http://api.example.com | jinja2 template.j2
```
## Install
```
$ uv tool install jinja2-cli
$ pip install jinja2-cli
```
## Formats
Built-in: JSON, INI, ENV, querystring, TOML (Python 3.11+)
Optional formats via extras:
```
$ pip install jinja2-cli[yaml]
$ pip install jinja2-cli[xml]
$ pip install jinja2-cli[hjson]
$ pip install jinja2-cli[json5]
```
## Features
- Read data from files or stdin
- Define variables inline with `-D key=value`
- Custom Jinja2 extensions
- **Import custom filters** - see [Custom Filters](#custom-filters) below
- Full control over Jinja2 environment options
Run `jinja2 --help` for all options, or see [docs/](docs/) for full documentation.
## Custom Filters
Extend Jinja2 with your own filters or use Ansible's extensive filter library:
```bash
# Use custom filters
$ jinja2 template.j2 data.json -F myfilters
# Use Ansible filters
$ jinja2 template.j2 data.json -F ansible.plugins.filter.core
```
Example filter module:
```python
# myfilters.py
def reverse(s):
return s[::-1]
def shout(s):
return s.upper() + "!"
```
See [docs/filters.md](docs/filters.md) for complete documentation and examples.
## Used by
- [Dangerzone](https://github.com/freedomofpress/dangerzone) by Freedom of the Press Foundation
- [Elastic](https://github.com/elastic/logstash-docker) Docker images (Logstash, Kibana, Beats)
- [ScyllaDB](https://github.com/scylladb/scylla-machine-image) CloudFormation templates
- [800+ more](https://github.com/mattrobenolt/jinja2-cli/network/dependents) on GitHub
## Available in
[](https://pypi.org/project/jinja2-cli/)
[](https://formulae.brew.sh/formula/jinja2-cli)
[](https://search.nixos.org/packages?query=jinja2-cli)
[](https://aur.archlinux.org/packages/jinja2-cli)
[](https://pkgs.alpinelinux.org/package/edge/community/x86_64/jinja2-cli)
## Learn more
- [Jinja2 as a Command Line Application](https://thejeshgn.com/2021/12/07/jinja2-command-line-application/)
- [Combining jinja2-cli with jq and environment variables](https://www.zufallsheld.de/2025/06/30/templating-jinja-cli)
نیازمندی
| مقدار | نام |
|---|---|
| - | jinja2>=3.1 |
| xtr | hjson; |
| xtr | json5; |
| ython_full_versio | tomli; |
| xtr | xmltodict; |
| xtr | pyyaml; |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.8 | Python |
نحوه نصب
نصب پکیج whl jinja2-cli-1.0.0b1:
pip install jinja2-cli-1.0.0b1.whl
نصب پکیج tar.gz jinja2-cli-1.0.0b1:
pip install jinja2-cli-1.0.0b1.tar.gz