Skip to main content

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_fnmatch_extension.FnMatchExtension"])

# For the example, we use a template from a simple string
template = env.from_string("{% raw %}{{ 'foo-bar'|fnmatch('foo-*') }}{% endraw %}")
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.

Source Distribution

jinja2_fnmatch_extension-0.0.4.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jinja2_fnmatch_extension-0.0.4-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file jinja2_fnmatch_extension-0.0.4.tar.gz.

File metadata

File hashes

Hashes for jinja2_fnmatch_extension-0.0.4.tar.gz
Algorithm Hash digest
SHA256 9385e7e69667fb2b7daaea3a56fe7783b22305134fb302b491f77d0defaffd09
MD5 e5c438fdaaa87a6e8f4a6983bf38aac1
BLAKE2b-256 b89db464351bdeada1a296dd04177ab867069d3d6a40e9c829bac3c99fcbe883

See more details on using hashes here.

File details

Details for the file jinja2_fnmatch_extension-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for jinja2_fnmatch_extension-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f123c5e3d22b2a83006327ca7b2e97279704d98ad429a0bf5a7d8e7ea200938a
MD5 6385aefde4a31517ae6d94bf79e0a3bd
BLAKE2b-256 b39532428dda4d53d6b02b8b597bd62499c21ab8cf228878198daa88d7a14672

See more details on using hashes here.

Supported by

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