Piglet: Fast Python Template Engine

Overview of Piglet templates

Piglet is a templating engine that compiles templates to fast python byte code. Piglet HTML templates look like this:

<py:extends href="base.html">
    <py:block name="content">
        Hello ${name}!
        <ul>
            <li py:for="item in bag">$item</li>
        </ul>
    </py:block>
</py:extends>

Learn more about Piglet’s template directives, or how to use piglet’s Python API.

Piglet also has a text mode:

{% extends "base.txt" %}
    {% block "content" %}
        Hello ${name}!
        {% for item in bag %}
        - $item
        {% end %}
    {% end %}
{% end %}

Piglet also contains flexible translation directives and is designed to work for internationalized applications.

Read more in the documentation contents.