LiquidPy

raw JSON →
0.9.0 verified Mon Apr 27 auth: no python

A Python port of the Liquid template engine, supporting multiple modes including Liquid, Jinja, Django, and wild. Version 0.9.0 drops support for Python 3.7 and 3.8.

pip install liquidpy
error ModuleNotFoundError: No module named 'liquid'
cause Using 'liquidpy' as import name instead of 'liquid'.
fix
Install liquidpy (pip install liquidpy) and import liquid (from liquid import Liquid).
error ImportError: cannot import name 'Liquid' from 'liquid'
cause Incorrect import path or old version.
fix
Upgrade to latest version: pip install --upgrade liquidpy, then use 'from liquid import Liquid'.
breaking Python 3.7 and 3.8 support dropped in v0.9.0
fix Upgrade to Python 3.9+.
gotcha Import from 'liquid', not 'liquidpy'
fix Use 'from liquid import Liquid'.
gotcha Mode selection: default mode may not match expectations
fix Explicitly set mode: Liquid('...', mode='liquid') or mode='jinja', 'django', 'wild'.

Basic rendering with Liquid template.

from liquid import Liquid

engine = Liquid("Hello {{ name }}!")
print(engine.render(name="World"))