34j / jinja2-eval

Jinja2 Extension for getting eval() result

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jinja2-eval

CI Status Documentation Status Test coverage percentage

Poetry black pre-commit

PyPI Version Supported Python versions License

Jinja2 Extension for getting eval() result.

Installation

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

pip install jinja2-eval

Usage

Basic usage:

{% eval "1 + 1" %}
{{ "1 + 1" | eval }}
2
2

Importing modules:

{% eval "exec('import math') or math.pi" %}
{{ "exec('import math') or math.pi" | eval }}
3.141592653589793
3.141592653589793

Contributors ✨

Thanks goes to these wonderful people (emoji key):

34j
34j

💻 🤔 📖

This project follows the all-contributors specification. Contributions of any kind welcome!

About

Jinja2 Extension for getting eval() result

License:Creative Commons Zero v1.0 Universal


Languages

Language:Python 91.7%Language:JavaScript 8.3%