Jinja2 Extension for Python Import keywords
So we don’t have to write a new jinja2 filter just for simple function.
It exposed a powerful weapon for shoot you feet, use it in your own risk!
Usage
Execute “echo hello” shell command and get the output
from jinja2 import Environment
env = Environment(extensions=['jinja2_pimport.PImportExtension'])
template = env.from_string("{{ ('subprocess'|pimport).check_output('echo hello', shell=True).strip().decode() }}")
template.render()
# => hello
License
Distributed under the terms of the MIT license, jinja2-pimport is free and open source software
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jinja2-pimport-0.1.8.tar.gz
(3.5 kB
view details)
File details
Details for the file jinja2-pimport-0.1.8.tar.gz.
File metadata
- Download URL: jinja2-pimport-0.1.8.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd3743d2587b3dd53c85a09a0d8d8e5fda2644b456239b70fab604db89b21cf1
|
|
| MD5 |
a9a9e4e6a08de734aabe3c702d0f328d
|
|
| BLAKE2b-256 |
47b8ec8d94ec3436ef994c5749da1e3c3eb24070ef9896a14bdaca897e3c85d0
|