Skip to content

Latest commit

 

History

History
68 lines (53 loc) · 2.3 KB

README.rst

File metadata and controls

68 lines (53 loc) · 2.3 KB

liquidpy

A port of liquid template engine for python

` .. image:: https://img.shields.io/pypi/v/liquidpy.svg?style=flat-square

target:https://img.shields.io/pypi/v/liquidpy.svg?style=flat-square
alt:Pypi

<https://pypi.org/project/liquidpy/>`_ `

https://img.shields.io/github/tag/pwwang/liquidpy.svg?style=flat-square:target:https://img.shields.io/github/tag/pwwang/liquidpy.svg?style=flat-square:alt:Github<https://github.com/pwwang/liquidpy>`_`

https://img.shields.io/pypi/pyversions/liquidpy.svg?style=flat-square:target:https://img.shields.io/pypi/pyversions/liquidpy.svg?style=flat-square:alt:PythonVers<https://pypi.org/project/liquidpy/>`_`

https://img.shields.io/readthedocs/liquidpy?style=flat-square:target:https://img.shields.io/readthedocs/liquidpy?style=flat-square:alt:ReadTheDocsbuilding<https://liquidpy.readthedocs.io/en/latest/>`_`

https://img.shields.io/travis/pwwang/liquidpy.svg?style=flat-square:target:https://img.shields.io/travis/pwwang/liquidpy.svg?style=flat-square:alt:Travisbuilding<https://travis-ci.org/pwwang/liquidpy>`_`

https://img.shields.io/codacy/grade/aed04c099cbe42dabda2b42bae557fa4?style=flat-square:target:https://img.shields.io/codacy/grade/aed04c099cbe42dabda2b42bae557fa4?style=flat-square:alt:Codacy<https://app.codacy.com/manual/pwwang/liquidpy/dashboard>`_`

https://img.shields.io/codacy/coverage/aed04c099cbe42dabda2b42bae557fa4?style=flat-square:target:https://img.shields.io/codacy/coverage/aed04c099cbe42dabda2b42bae557fa4?style=flat-square:alt:Codacycoverage<https://app.codacy.com/manual/pwwang/liquidpy/dashboard>`_

Install

pip install liquidpy

Full Documentation

ReadTheDocs

Baisic usage

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

# load template from a file
liq = Liquid('/path/to/template', liquid_from_file=True)

With environments:

liq = Liquid('{{a | os.path.basename}}', os=__import__('os'))
ret = liq.render(a="path/to/file.txt")
# ret == 'file.txt'