Skip to main content

jinja2-shell

CI Status Documentation Status

Test coverage percentage uv Ruff prek

PyPI Version Supported Python versions License


Documentation: https://jinja2-shell.readthedocs.io

Source Code: https://github.com/34j/jinja2-shell


Jinja2 Extension for getting eval() result.

Installation

Install this via pip (or your favourite package manager):

pip install jinja2-shell

Usage

The extension class is jinja2_shell.ShellExtension.

If the second argument is True (default), the output is stripped of trailing whitespace and newlines. (a\n\b \n -> a\nb)

As a statement:

{% shell "echo Hello World" %}
{% shell "echo Hello World", False %}
{% shell "echo 'Hello World', False %}
{% shell "echo \"Hello World\"", False %}
Hello World
Hello World (Ubuntu), Hello World\n (Windows)
Hello World (Ubuntu), Hello World\n (Windows)
Hello World (Ubuntu), Hello World\n (Windows)

As a expression:

{{ "echo Hello World" | shell }}
{{ "echo Hello World" | shell(False) }}
{{ "echo 'Hello World'" | shell(False) }}
{{ "echo \"Hello World\"" | shell(False) }
Hello World
Hello World (Ubuntu), Hello World\n (Windows)
Hello World (Ubuntu), Hello World\n (Windows)
Hello World (Ubuntu), Hello World\n (Windows)

Metadata

Release files for jinja2-shell 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jinja2-shell 1.0.1
File Size Uploaded Provenance Actions
jinja2_shell-1.0.1.tar.gz 6.7 kB With provenance Details for jinja2_shell-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jinja2-shell 1.0.1
File Interpreter ABI Platform Actions
jinja2_shell-1.0.1-py3-none-any.whl Python 3 none any Details for jinja2_shell-1.0.1-py3-none-any.whl

Total release size: 13.2 kB

Release files / jinja2_shell-1.0.1.tar.gz

Download URL jinja2_shell-1.0.1.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b19bd57f8b95367fe7c767c8e37c1110fc2b84705dd4cc8152a94499b4af6a1a
BLAKE2b-256 checksum
How to use checksums
9ef89d04f0aa63c245591b8738f9e539bce060959c4dc0cba4b43d4d99f7e120
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / jinja2_shell-1.0.1-py3-none-any.whl

Download URL jinja2_shell-1.0.1-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb1470b287515ed059e592b401cae42a9183e6b9a21d03fcae7acb5cc4f2c07d
BLAKE2b-256 checksum
How to use checksums
3a8e8fe4e1b63164741e66a497b32ee54cc810f9a9baf4d878c2006dbf4c7510
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Security for jinja2-shell 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for jinja2_shell-1.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page