Skip to main content

a jinja2 extension to add a fnmatch filter

Project description


Status (master branch)

GitHub CI Maintenance

What is it ?

This is a jinja2 extension to expose fnmatch function.


The syntax is |fnmatch(pattern).


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 file.

Code of Conduct

See file.


(If you are officially paid to work on MetWork Framework, please contact us to add your company logo here!)


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_fnmatch_extension-1.0.2.tar.gz (3.3 kB view hashes)

Uploaded source

Built Distribution

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