Skip to main content

a jinja2 extension to access to system environment variables

Project description

jinja2_shell_extension

Status (master branch)

GitHub CI Maintenance

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("Wed, 19 Jul 2023 11:16:39 +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!)

logo

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

jinja2_shell_extension-2.0.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

jinja2_shell_extension-2.0.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file jinja2_shell_extension-2.0.1.tar.gz.

File metadata

File hashes

Hashes for jinja2_shell_extension-2.0.1.tar.gz
Algorithm Hash digest
SHA256 0512f0ec9e7b73aac3df034e452de7438825347c2f5b59825962cad549a7ac0e
MD5 6e4c91e67f09bcf48489bcb9dc92a620
BLAKE2b-256 8a91e5994701b927f9b55aa3d0ba11e7c9e15ff683c0796a63e1aa2b9342fbde

See more details on using hashes here.

File details

Details for the file jinja2_shell_extension-2.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for jinja2_shell_extension-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e3b1b514af64fb0610ac5391c670932105bab33b889d6ea2dce5192e1b10cda5
MD5 cc2bf66eb300bdb413751020d29dab7e
BLAKE2b-256 aa2c37abfcbbf33f6bd335be2c7a68fbc0cfa9d3f7b2bc58d53e907deb563072

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page