Python Liquid
Python Liquid is a Python engine for Liquid, the safe, customer-facing template language.
We follow Shopify/Liquid closely and test against the Golden Liquid test suite.
Table of Contents
Install
Install python-liquid from PyPi using your favorite package manager.
pip
pip install python-liquid
uv
uv add python-liquid
pipenv
pipenv install -u python-liquid
conda
conda install -c conda-forge python-liquid
Links
- Documentation: https://jg-rp.github.io/liquid/
- Documentation for Python Liquid version 1.x: https://jg-rp.github.io/python-liquid-docs-archive/
- Documentation for Python Liquid version 2.x: https://github.com/jg-rp/liquid/blob/v2.3.6/docs/index.md
- Change Log: https://github.com/jg-rp/liquid/blob/main/CHANGES.md
- PyPi: https://pypi.org/project/python-liquid/
- Source Code: https://github.com/jg-rp/liquid
- Issue Tracker: https://github.com/jg-rp/liquid/issues
Related Projects
- Python Liquid2: A new Python engine for Liquid with extra features.
- Ruby Liquid2: Liquid2 templates for Ruby.
- Micro Liquid: A stripped-down Liquid-like template engine for Python. You can think of it as a non-evaluating alternative to Python's f-strings or t-strings.
- LiquidScript: A JavaScript engine for Liquid with a similar high-level API to Python Liquid.
Quick Start
render()
Use the package-level liquid.render() function to render a template with Liquid's default configuration. The first argument is template source code and the second is a dictionary of template variables.
import liquid
print(liquid.render("Hello, {{ you }}!", {"you": "World"})) # Hello, World!
parse()
Use liquid.parse() to get an instance of liquid.Template, which can be rendered multiple times with different data.
from liquid import parse
template = parse("Hello, {{ you }}!")
print(template.render(you="World")) # Hello, World!
print(template.render(you="Liquid")) # Hello, Liquid!
Configure
You'll need to create an instance of liquid.Environment to configure Liquid, then load and render templates from that.
from liquid import Environment, CachingFileSystemLoader
env = Environment(
autoescape=True,
loader=CachingFileSystemLoader("./templates")
)
template = env.get_template("index.liquid")
another_template = env.parse("{% render 'greeting' %}, World!")
See docs.
Contributing
Please see Contributing to Python Liquid.
Metadata
Release files for python-liquid 3.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| python_liquid-3.0.0.tar.gz | 79.5 kB | With provenance | Details for python_liquid-3.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_liquid-3.0.0-py3-none-any.whl | Python 3 | none | any | Details for python_liquid-3.0.0-py3-none-any.whl |
Total release size: 211.3 kB
Release files / python_liquid-3.0.0.tar.gz
| Download URL | python_liquid-3.0.0.tar.gz |
|---|---|
| Size | 79.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
88b4b676e41f6ff6e92106c6ddf006370c6f1bfcc2d1f26f7380ea0a7e9da004
|
|
BLAKE2b-256 checksum How to use checksums |
9d121f4a0c70565c4e23f73c6f7e5d637f0969fcc8bef69c91616c785cdca453
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.
Transparency logRelease files / python_liquid-3.0.0-py3-none-any.whl
| Download URL | python_liquid-3.0.0-py3-none-any.whl |
|---|---|
| Size | 131.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0070d22cf531a4179db3151c6cab7e9eabc05cca012b916e9ee4ff43d536487a
|
|
BLAKE2b-256 checksum How to use checksums |
5377e580e34ed90da6e15882d20f97d03abfea0410941e06c1789368479c6b69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.
Transparency logSecurity for python-liquid 3.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for python_liquid-3.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.