a jinja2 extension to access to system environment variables
Project description
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("{{ 'date --rfc-2822'|shell() }}")
result = template.render()
# example: result == "Fri, 31 Jan 2020 13:35:56 +0100"
# [...]
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-0.0.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12808f1bcfb2f399558bb1187254e9322d3a5a183e8589f48c6217f7fbcc4e45 |
|
MD5 | a42a61244fb8d6f95499076002e960ef |
|
BLAKE2b-256 | 2a8a70485a19366bf66f90ce732d43674407b7b4c4065c71437ed4858ab32f89 |
Close
Hashes for jinja2_shell_extension-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55348e2b141f3997d20a7208dfe4e1d72b886c25cf8ea6e7f20e8f307393d86c |
|
MD5 | 7ea42135f744b93b9dde7317aa201bc7 |
|
BLAKE2b-256 | 4db61ac1468135f79e822adcef931c1849c11c38d2115489e0331043dbd20e42 |