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
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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41808521ae4c2cc44758da29988bc5e2cb71e36f4f1549de3369b5ead55019cc |
|
MD5 | 888f974e63c35a09d55f67c3b21d9595 |
|
BLAKE2b-256 | 39495abe7aeeebff20393fa0cb338cc5124631e1e88ca70f1fbb62fc00ea2135 |
Close
Hashes for jinja2_fnmatch_extension-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76df3323cb854a95d2fe0299afda5aa0bf116ab6ff9408714edf3b7e77961e39 |
|
MD5 | 2b3cb9e49de265be27ada4efeef3bd57 |
|
BLAKE2b-256 | 54163fd6ef5e9cccf3a8b71c299902362e01b8e0da200c3387cb1c3c9b627ed2 |