Skip to main content

Simple template engine for python

Project description


Lighty-template is very simple template engine for python (
Template syntax looks like django-template or jinja2 template. But template
engine code is easier and gives a way to write all needed tags without any

Now it does not include all features django-template or jinja2 supports, but
I'll try to fix it as soon as possible.


- Stupid simple syntax almost compatible with django-template.
- Pure python.
- Supports both Python 2 (checked with 2.7.2) and Python 3 (checked with 3.2.2)
- Fast. From 3 to 10 times faster than django-template and even faster on some
benchmarks than jinja2 (but in one benchmark 2 times slower).
- Simple and compact code.
- Template filters with multiply arguments.
- Basic template filters included (now just 14 template filters).
- Basic template tags included.
- Simple but powerfull tag declaration - it's easy to create your own block
tags with writing single function.
- Custom template tags can modify template on fly.


Here a small template example:

<!DOCTYPE html>
<title>{{ title }}</title>
{% block style %}{% endblock %}
{% block script %}{% endblock %}
{% block content %}
<h1>Hello, {{ name }}!</h1>
<p>Some text here</p>
{% endblock %}
{% include "includes/footer.html" %}


- More default tags (now there is no load tags, and if and for tags was
simplified and requires additional work).
- More default filters (strings saving, etc.)
- Some additional execution optimizations.
- More tests (in progress).
- Documentation.
- Thinking about unicode and escaping.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lighty-template-0.3.4.tar.gz (11.5 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page