Skip to main content

liquidpy

A port of liquid template engine for python, on the shoulder of jinja2

Pypi Github PythonVers Docs building Travis building Codacy Codacy coverage

Install

pip install -U liquidpy

Playground

Powered by pyscript:

https://pwwang.github.io/liquidpy/playground

Baisic usage

Loading a template

from liquid import Liquid
liq = Liquid('{{a}}', from_file=False)
ret = liq.render(a = 1)
# ret == '1'

# load template from a file
liq = Liquid('/path/to/template.html')

Using jinja's environment

from jinja2 import Environment, FileSystemLoader
env = Environment(loader=FileSystemLoader('./'), ...)

liq = Liquid.from_env("/path/to/template.html", env)

Switching to a different mode

liq = Liquid(
    """
    {% python %}
    from os import path
    filename = path.join("a", "b")
    {% endpython %}
    {{filename}}
    """,
    mode="wild" # supported: standard(default), jekyll, shopify, wild
)
liq.render()
# 'a/b'

Changing default options

from liquid import defaults, Liquid
defaults.FROM_FILE = False
defaults.MODE = 'wild'

# no need to pass from_file and mode anymore
liq = Liquid('{% from_ os import path %}{{path.basename("a/b.txt")}}')
liq.render()
# 'b.txt'

Documentation

Metadata

Release files for liquidpy 0.8.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for liquidpy 0.8.3
File Size Uploaded Provenance Actions
liquidpy-0.8.3.tar.gz 26.1 kB Without provenance Details for liquidpy-0.8.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for liquidpy 0.8.3
File Interpreter ABI Platform Actions
liquidpy-0.8.3-py3-none-any.whl Python 3 none any Details for liquidpy-0.8.3-py3-none-any.whl

Total release size: 58.7 kB

Release files / liquidpy-0.8.3.tar.gz

Download URL liquidpy-0.8.3.tar.gz
Size 26.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e8f716d2ff7b95b2145650ca60f9f9c3222daf3afabc94f592c6cde1612d8b37
BLAKE2b-256 checksum
How to use checksums
007b2f86b9d439d82a021cdcbcf9dffd0f7e85dde370fc7181e89cc000be3a4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.12.3 Linux/6.8.0-1017-azure

Release files / liquidpy-0.8.3-py3-none-any.whl

Download URL liquidpy-0.8.3-py3-none-any.whl
Size 32.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6472188d0de6e19dd56d582eeec7c4cc6f263b0c358a6a476e8d8793a78b4f6
BLAKE2b-256 checksum
How to use checksums
1f1de418eec353f568c9223d4d945cd0730ed4788694cc4faad7d5c78381b798
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.12.3 Linux/6.8.0-1017-azure

Security for liquidpy 0.8.3

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.8.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page