Skip to main content
Lighty-template
~~~~~~~~~~~~~~~

Lighty-template is very simple template engine for python (python.org).
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
hacks.

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

Features:
---------

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

Example:
--------

Here a small template example:

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

TODO:
-----

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

Metadata

Release files for lighty-template 0.3.4

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

Source distribution (sdist)

Source distribution for lighty-template 0.3.4
File Size Uploaded Provenance Actions
lighty-template-0.3.4.tar.gz 11.5 kB Without provenance Details for lighty-template-0.3.4.tar.gz

Release files / lighty-template-0.3.4.tar.gz

Download URL lighty-template-0.3.4.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1c7c70c902d34d8867c5157b9095477d37969e6c576d4f95147b39a971ba742e
BLAKE2b-256 checksum
How to use checksums
c1ea62c3e49c2a21689ef0c3f9dbe8c73bbcae82238aba7e1fb38211cdfc0bb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for lighty-template 0.3.4

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.

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