a jinja2 extension to access to system environment variables
Project description
jinja2_shell_extension
Status (master branch)
What is it ?
This is a jinja2 extension to execute system/shell commands from a template.
WARNING: be sure to valid any string submitted to this filter as you can open security holes with it
Syntax
The syntax is 'full_command_with_args'|shell([die_on_error_boolean_flag], [encoding])
.
Example
from jinja2 import Template, Environment
# We load the extension in a jinja2 Environment
env = Environment(extensions=["jinja2_shell_extension.ShellExtension"])
# For the example, we use a template from a simple string
template = env.from_string("Tue, 25 Oct 2022 11:27:06 +0000
")
result = template.render()
# example: result == "Fri, 31 Jan 2020 13:35:56 +0100"
# [...]
Contributing guide
See CONTRIBUTING.md file.
Code of Conduct
See CODE_OF_CONDUCT.md file.
Sponsors
(If you are officially paid to work on MetWork Framework, please contact us to add your company logo here!)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for jinja2_shell_extension-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99a5a1dcff8b163f3336a248ec21e13479ff88250e40746c9a40229f932509a4 |
|
MD5 | 690f7c694487be8e690d2cc14a71cbcd |
|
BLAKE2b-256 | dffb929f10027e49ac279d09b8045951b7cca2d7fd9419873b62c0af54561b40 |
Close
Hashes for jinja2_shell_extension-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93b5c9fe966bd7d93a991f4e8a00466d8a1e9ef8369c412b1c1bcc9be11a81a9 |
|
MD5 | 0d661e5dbb04384e28f97acf1a3eab6f |
|
BLAKE2b-256 | 5a3ade3f05753b0f1114d66b58c75d486ad2e10b645a28d5389036f42ccf4487 |