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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67ba04eb9369e3f848d9c309ebeadcd35570bb1c682517aa85e6b2f3a4f7c4ff |
|
MD5 | 064134e2478bcb6fd3819caba58ef095 |
|
BLAKE2b-256 | ffe9d5b94e2982ed2a5e7029480faac626e060d4b8c81ec8a79f8bb8ce61cdce |
Close
Hashes for jinja2_shell_extension-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d24c0935dd7b0b7551133aa1b18ddfc3e607cfc423c258f307c50b8f21aeceb6 |
|
MD5 | 7041f1159f60e0af41a790b601de9bd8 |
|
BLAKE2b-256 | f7451679c429781c977d81ea5a698baaa89831271048ab9d172de120315e923e |