{"id":21283347,"url":"https://github.com/jg-rp/liquid","last_synced_at":"2025-04-12T18:51:54.161Z","repository":{"id":44468536,"uuid":"304351404","full_name":"jg-rp/liquid","owner":"jg-rp","description":"A Python engine for the Liquid template language.","archived":false,"fork":false,"pushed_at":"2025-04-09T14:26:00.000Z","size":17762,"stargazers_count":71,"open_issues_count":3,"forks_count":11,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T11:55:11.070Z","etag":null,"topics":["liquid","liquid-templating-engine","pypy3","python","template-engine","templates"],"latest_commit_sha":null,"homepage":"https://jg-rp.github.io/liquid/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jg-rp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"contributing.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"jg-rp"}},"created_at":"2020-10-15T14:25:27.000Z","updated_at":"2025-04-09T14:25:58.000Z","dependencies_parsed_at":"2023-10-13T00:33:02.075Z","dependency_job_id":"89a7188f-7628-408a-828d-352323751437","html_url":"https://github.com/jg-rp/liquid","commit_stats":{"total_commits":397,"total_committers":4,"mean_commits":99.25,"dds":"0.10327455919395467","last_synced_commit":"81b74cb13880dbd86726307fa80cb00f508124ab"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jg-rp%2Fliquid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jg-rp%2Fliquid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jg-rp%2Fliquid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jg-rp%2Fliquid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jg-rp","download_url":"https://codeload.github.com/jg-rp/liquid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248565088,"owners_count":21125415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["liquid","liquid-templating-engine","pypy3","python","template-engine","templates"],"created_at":"2024-11-21T11:07:59.437Z","updated_at":"2025-04-12T18:51:54.136Z","avatar_url":"https://github.com/jg-rp.png","language":"Python","funding_links":["https://github.com/sponsors/jg-rp"],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003ePython Liquid\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\nPython Liquid is a Python engine for \u003ca href=\"https://shopify.github.io/liquid/\"\u003eLiquid\u003c/a\u003e, the safe, customer-facing template language.\n\u003cbr\u003e\nWe follow \u003ca href=\"https://github.com/Shopify/liquid\"\u003eShopify/Liquid\u003c/a\u003e closely and test against the \u003ca href=\"https://github.com/jg-rp/golden-liquid\"\u003eGolden Liquid\u003c/a\u003e test suite.\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pypi.org/project/python-liquid/\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/v/python-liquid.svg?style=flat-square\" alt=\"PyPi - Version\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://anaconda.org/conda-forge/python-liquid\"\u003e\n    \u003cimg src=\"https://img.shields.io/conda/vn/conda-forge/python-liquid?style=flat-square\" alt=\"conda-forge\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/python-liquid/\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/pyversions/python-liquid.svg?style=flat-square\" alt=\"Python versions\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://github.com/jg-rp/liquid/actions/workflows/tests.yaml\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/jg-rp/liquid/tests.yaml?branch=main\u0026label=tests\u0026style=flat-square\" alt=\"Tests\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/jg-rp/liquid/actions/workflows/coverage.yaml\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/jg-rp/liquid/coverage.yaml?branch=main\u0026label=coverage\u0026style=flat-square\" alt=\"Coverage\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://pypi.org/project/python-liquid/\"\u003e\n    \u003cimg alt=\"PyPI - Downloads\" src=\"https://img.shields.io/pypi/dm/python-liquid?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://github.com/jg-rp/liquid/blob/main/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/l/python-liquid.svg?style=flat-square\" alt=\"License\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n**Table of Contents**\n\n- [Install](#install)\n- [Links](#links)\n- [Related Projects](#related-projects)\n- [Quick Start](#example)\n- [Contributing](#contributing)\n\n## Install\n\nInstall Python Liquid using [Pipenv](https://pipenv.pypa.io/en/latest/):\n\n```shell\n$ pipenv install -u python-liquid\n```\n\nOr [pip](https://pip.pypa.io/en/stable/getting-started/):\n\n```shell\n$ pip install python-liquid\n```\n\nOr from [conda-forge](https://anaconda.org/conda-forge/python-liquid):\n\n```shell\n$ conda install -c conda-forge python-liquid\n```\n\n## Links\n\n- Documentation: https://jg-rp.github.io/liquid/\n- Documentation for Python Liquid version 1.x: https://jg-rp.github.io/python-liquid-docs-archive/\n- Change Log: https://github.com/jg-rp/liquid/blob/main/CHANGES.md\n- PyPi: https://pypi.org/project/python-liquid/\n- Source Code: https://github.com/jg-rp/liquid\n- Issue Tracker: https://github.com/jg-rp/liquid/issues\n\n## Related Projects\n\n- [Python Liquid2](https://github.com/jg-rp/python-liquid2): A new Python engine for Liquid with [extra features](https://jg-rp.github.io/python-liquid2/migration/#new-features).\n- [LiquidScript](https://github.com/jg-rp/liquidscript): A JavaScript engine for Liquid with a similar high-level API to Python Liquid.\n\n## Quick Start\n\n### `render()`\n\nThis example renders a template from a string of text with the package-level `render()` function. The template has just one placeholder variable `you`, which we've given the value `\"World\"`.\n\n```python\nfrom liquid import render\n\nprint(render(\"Hello, {{ you }}!\", you=\"World\"))\n# Hello, World!\n```\n\n### `parse()`\n\nOften you'll want to render the same template several times with different variables. We can parse source text without immediately rendering it using the `parse()` function. `parse()` returns a `BoundTemplate` instance with a `render()` method.\n\n```python\nfrom liquid import parse\n\ntemplate = parse(\"Hello, {{ you }}!\")\nprint(template.render(you=\"World\"))  # Hello, World!\nprint(template.render(you=\"Liquid\"))  # Hello, Liquid!\n```\n\n### Configure\n\nBoth `parse()` and `render()` are convenience functions that use the default Liquid environment. For all but the simplest cases, you'll want to configure an instance of `Environment`, then load and render templates from that.\n\n```python\nfrom liquid import CachingFileSystemLoader\nfrom liquid import Environment\n\nenv = Environment(\n    autoescape=True,\n    loader=CachingFileSystemLoader(\"./templates\"),\n)\n```\n\nThen, using `env.parse()` or `env.get_template()`, we can create a `BoundTemplate` from a string or read from the file system, respectively.\n\n```python\n# ... continued from above\ntemplate = env.parse(\"Hello, {{ you }}!\")\nprint(template.render(you=\"World\"))  # Hello, World!\n\n# Try to load \"./templates/index.html\"\nanother_template = env.get_template(\"index.html\")\ndata = {\"some\": {\"thing\": [1, 2, 3]}}\nresult = another_template.render(**data)\n```\n\nUnless you happen to have a relative folder called `templates` with a file called `index.html` within it, we would expect a `TemplateNotFoundError` to be raised when running the example above.\n\n## Contributing\n\nPlease see [Contributing to Python Liquid](https://github.com/jg-rp/liquid/blob/main/contributing.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjg-rp%2Fliquid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjg-rp%2Fliquid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjg-rp%2Fliquid/lists"}