Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

a jinja2 extension to add a fnmatch filter

Project description

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_getenv_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"
# [...]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for jinja2-fnmatch-extension, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size jinja2_fnmatch_extension-0.0.2-py3-none-any.whl (3.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size jinja2_fnmatch_extension-0.0.2.tar.gz (2.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page