Python Liquid JSONPath
Requires Python Liquid version 1.9.2 or later.
The Liquid JSONPath package brings JSONPath syntax to Liquid templates.
info
See the Python JSONPath docs for JSONPath selector syntax.
Install
Install JSONPath for Liquid using pip:
python -m pip install -U liquid-jsonpath
Or pipenv:
pipenv install liquid-jsonpath
Configure
Filters and tags provided by Liquid JSONPath must be registered with an Environment
, just like you would with custom tags or filters.
from liquid import Environment
from liquid_jsonpath import Find
from liquid_jsonpath import JSONPathForTag
env = Environment()
env.add_filter("find", Find())
env.add_tag(JSONPathForTag)
# ...