skillfed

python-liquid

A Python engine for the Liquid template language.

python-liquid v2.3.1 1.3M downloads/30d#4,096 on PyPI98
Permissive license MIT Active released

What it is and what it does

Python Liquid is a Liquid template engine—a safe, expression-based template language originally from Shopify—implemented in pure Python. It parses and renders templates that contain variable placeholders, filters, control flow (if/for/unless), and other Liquid constructs, making it suitable for customer-facing or untrusted template input where you need safety guarantees that general-purpose Python code execution would not provide.

The package offers two main entry points: a simple `render()` function for one-off template rendering, and an `Environment` class for managing multiple templates, configuring autoescape and template loaders, and reusing parsed templates. It follows Shopify's Liquid specification closely and validates against the Golden Liquid test suite. Runtime dependencies handle date/time operations (python-dateutil, pytz), internationalization (babel), HTML escaping (markupsafe), and resource loading (importlib-resources).

Use it for:

  • Render user-supplied or customer-provided templates safely without executing arbitrary Python code
  • Generate HTML emails or documents from template files with variable substitution and conditional logic
  • Build a template-based reporting or document generation system with Shopify Liquid syntax
  • Migrate Liquid templates from Ruby or JavaScript environments to a Python backend
  • Implement a theme or customization system where end users write templates in a familiar, safe syntax

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Python Liquid is a template engine that renders Liquid templates—a safe, customer-facing template language used by Shopify—from strings or files with variable substitution and control flow.

Yes. Python Liquid is actively maintained, has no known vulnerabilities, installs with low friction, and is MIT-licensed. It is a solid choice if you need Liquid template rendering in Python—particularly if you are migrating from Shopify or another Liquid implementation, or if you need to safely render customer-supplied templates. The Golden Liquid test suite alignment is a strong signal of correctness.

Install

python-liquid on PyPI

pip

pip install python-liquid

uv

uv add python-liquid

poetry

poetry add python-liquid

Installing python-liquid

Before you install

Low friction: pure Python wheel with five common runtime dependencies (babel, markupsafe, python-dateutil, pytz, importlib-resources). Actively maintained—last commit 2026-08-08, released 6 days ago. Supports Python 3.9 through 3.14 on CPython and PyPy.

License in practice

MIT license (permissive): you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions, provided you include the license notice.

Quickstart

from liquid import render

print(render("Hello, {{ you }}!", you="World"))
# Hello, World!

# Or parse once, render many times:
from liquid import parse
template = parse("Hello, {{ you }}!")
print(template.render(you="World"))

Verify before relying

  • Performance characteristics compared to other Liquid implementations or template engines
  • Whether the Golden Liquid test suite coverage is complete or if edge cases remain
  • Support for custom filters, tags, or extensions beyond the standard Liquid spec

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 5 — babel, importlib-resources, markupsafe, python-dateutil, pytz
Maintenance actively maintained — 6 days since the last release
Last repo commit
First released
Downloads 1,293,845/month — #4,096 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: python_liquid-2.3.1-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

liquid template engine pythonshopify liquid templatessafe template renderingtemplate language pythonjinja alternative templatecustomer-facing templatesliquid syntax python
template-engineshopify-liquid

More Markup packages