Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/avelino/quik
A fast and lightweight Python template engine
https://github.com/avelino/quik
Last synced: about 2 months ago
JSON representation
A fast and lightweight Python template engine
- Host: GitHub
- URL: https://github.com/avelino/quik
- Owner: avelino
- License: mit
- Archived: true
- Created: 2013-09-03T05:09:25.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-11-13T22:40:55.000Z (almost 11 years ago)
- Last Synced: 2024-05-01T21:05:55.623Z (5 months ago)
- Language: Python
- Homepage: http://quik.readthedocs.org/
- Size: 287 KB
- Stars: 46
- Watchers: 5
- Forks: 10
- Open Issues: 7
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
====
Quik
====.. image:: https://travis-ci.org/avelino/quik.png?branch=master
:target: https://travis-ci.org/avelino/quik
:alt: Build Status - Travis CIA fast and lightweight Python template engine
Features
--------- Easy to use.
- High performance.
- Autoescaping.
- Template inheritance.
- Supports native python expressions.Install
-------.. code-block:: shell
pip install quik
or developer mode:
.. code-block:: shell
pip install -r git+https://github.com/avelino/quik.git#egg=quik
Nutshell
--------Here a small example of a Quik template
.. code-block:: html
- @user.username
#for @user in @users:
#if @user.age > 18:
#end
#end
Use It
------
Render via template:
.. code-block:: python
from quik import FileLoader
loader = FileLoader('html')
template = loader.load_template('index.html')
print template.render({'author': 'Thiago Avelino'},
loader=loader).encode('utf-8')
Render via string:
.. code-block:: python
from quik import Template
temp = Template("""
- @user.username
#for @user in @users:
#if @user.age > 18:
#end
#end
""")
users = [
{'username': 'foo', 'url': 'http://...', 'age': 25},
{'username': 'bar', 'url': 'https://...', 'age': 18}]
print temp.render(locals())