jinja2-fnmatch-extension

a jinja2 extension to add a fnmatch filter


Keywords
jinja2, extension, autoreadme, github-actions, integration-level-3, jinja2-extension
License
BSD-3-Clause
Install
pip install jinja2-fnmatch-extension==1.0.2

Documentation

jinja2_fnmatch_extension

Status (master branch)

GitHub CI Maintenance

What is it ?

This is a jinja2 extension to expose fnmatch function.

Syntax

The syntax is |fnmatch(pattern).

Example

from jinja2 import Template, Environment

# We load the extension in a jinja2 Environment
env = Environment(extensions=["jinja2_fnmatch_extension.FnMatchExtension"])

# For the example, we use a template from a simple string
template = env.from_string("{{ 'foo-bar'|fnmatch('foo-*') }}")
result = template.render()

assert result == "True"
# [...]

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