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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for jinja2_fnmatch_extension-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9385e7e69667fb2b7daaea3a56fe7783b22305134fb302b491f77d0defaffd09 |
|
MD5 | e5c438fdaaa87a6e8f4a6983bf38aac1 |
|
BLAKE2b-256 | b89db464351bdeada1a296dd04177ab867069d3d6a40e9c829bac3c99fcbe883 |
Close
Hashes for jinja2_fnmatch_extension-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f123c5e3d22b2a83006327ca7b2e97279704d98ad429a0bf5a7d8e7ea200938a |
|
MD5 | 6385aefde4a31517ae6d94bf79e0a3bd |
|
BLAKE2b-256 | b39532428dda4d53d6b02b8b597bd62499c21ab8cf228878198daa88d7a14672 |