Giter Club home page Giter Club logo

jinja2-shell's Introduction

jinja2-shell

CI Status Documentation Status Test coverage percentage

Poetry black pre-commit

PyPI Version Supported Python versions License

Jinja2 Extension for running shell commands. Makes use of subprocess.run(shell=False).

Installation

Install this via pip (or your favourite package manager):

pip install jinja2-shell

Usage

The extension class is jinja2_shell.ShellExtension.

If the second argument is True (default), the output is stripped of trailing whitespace and newlines. (a\n\b \n -> a\nb)

As a statement:

{% shell "echo Hello World" %}
{% shell "echo Hello World", False %}
{% shell "echo 'Hello World', False %}
{% shell "echo \"Hello World\"", False %}
Hello World
Hello World (Ubuntu), Hello World\n (Windows)
Hello World (Ubuntu), Hello World\n (Windows)
Hello World (Ubuntu), Hello World\n (Windows)

As a expression:

{{ "echo Hello World" | shell }}
{{ "echo Hello World" | shell(False) }}
{{ "echo 'Hello World'" | shell(False) }}
{{ "echo \"Hello World\"" | shell(False) }
Hello World
Hello World (Ubuntu), Hello World\n (Windows)
Hello World (Ubuntu), Hello World\n (Windows)
Hello World (Ubuntu), Hello World\n (Windows)

Contributors โœจ

Thanks goes to these wonderful people (emoji key):

34j
34j

๐Ÿ’ป ๐Ÿค” ๐Ÿ“–

This project follows the all-contributors specification. Contributions of any kind welcome!

jinja2-shell's People

Contributors

34j avatar renovate[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar

jinja2-shell's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update pre-commit hook pycqa/bandit to v1.7.9
  • chore(deps): update pre-commit/action action to v3.0.1
  • fix(deps): update dependency jinja2 to v3.1.4
  • chore(deps): update pre-commit hook asottile/pyupgrade to v3.17.0
  • chore(deps): update pre-commit hook codespell-project/codespell to v2.3.0
  • chore(deps): update pre-commit hook pre-commit/pre-commit-hooks to v4.6.0
  • chore(deps): update pre-commit hook pycqa/autoflake to v2.3.1
  • chore(deps): update pre-commit hook python-poetry/poetry to v1.8.3
  • chore(deps): update snok/install-poetry action to v1.4.1
  • chore(deps): update wagoid/commitlint-github-action action to v5.5.1
  • chore(deps): update dependency pytest-cov to v5
  • chore(deps): update relekang/python-semantic-release action to v9
  • chore(deps): update wagoid/commitlint-github-action action to v6
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

copier
.copier-answers.yml
github-actions
.github/workflows/ci.yml
  • actions/checkout v3
  • actions/setup-python v4
  • pre-commit/action v3.0.0
  • actions/checkout v3
  • wagoid/commitlint-github-action v5.4.5
  • actions/checkout v3
  • actions/setup-python v4
  • snok/install-poetry v1.3.4
  • codecov/codecov-action v3
  • actions/checkout v3
  • relekang/python-semantic-release v7.34.6
.github/workflows/hacktoberfest.yml
  • browniebroke/hacktoberfest-labeler-action v2.3.0
.github/workflows/issue-manager.yml
  • tiangolo/issue-manager 0.5.0
.github/workflows/labels.yml
  • actions/checkout v3
  • actions/setup-python v4
pep621
pyproject.toml
  • poetry-core >=1.0.0
poetry
pyproject.toml
  • python ^3.8
  • jinja2 *
  • pytest ^7.0
  • pytest-cov ^4.0
  • parameterized ^0.9.0
  • myst-parser >=0.16
  • sphinx >=4.0
  • sphinx-rtd-theme >=1.0
pre-commit
.pre-commit-config.yaml
  • commitizen-tools/commitizen v2.42.1
  • pre-commit/pre-commit-hooks v4.5.0
  • python-poetry/poetry 1.7.1
  • pre-commit/mirrors-prettier v2.7.1
  • asottile/pyupgrade v3.15.0
  • PyCQA/autoflake v2.2.1
  • PyCQA/isort 5.13.2
  • psf/black 23.12.1
  • codespell-project/codespell v2.2.6
  • PyCQA/flake8 6.1.0
  • pre-commit/mirrors-mypy v0.991
  • PyCQA/bandit 1.7.7

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.