Skip to main content

Fast, robust HTML templating engine

Project description

piglet-templates is a text and HTML templating engine in the genshi/kajiki templates family.

The Piglet template engine offers:

  • Template inhertitance through <py:extends>/<py:block> (similar to Jinja2)

  • Compiles templates to fast python byte code.

  • HTML templating: templates produce well formed HTML. Template variables are autoescaped to protect against XSS attacks.

  • Reusable template functions.

  • Good i18n support.

  • Clear tracebacks from exceptions raised in templates.

Piglet Template Engine Documentation | Repository

Example piglet template:

<py:extends href="layout.html">
    <py:block name="content">
        <h1>This is the content block.</h1>
        <p>
            Hello $user.firstnames $user.lastname!
        </p>
        <p py:for="verse in poem">
            <py:for each="line in verse">$line<br/></py:for>
        </p>
    </py:block>
</py:extends>

There’s a text templating mode too:

Hello $user.firstnames $user.lastname!

{% for verse in poem %}
    {% for line in verse %}$line
    {% end %}
{% end %}

License

Piglet-templates is licensed under the Apache license version 2.0.

Piglet-templates is developed by Olly Cope and was created for skot.be

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

piglet_templates-1.3.3.tar.gz (51.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

piglet_templates-1.3.3-py3-none-any.whl (67.5 kB view details)

Uploaded Python 3

File details

Details for the file piglet_templates-1.3.3.tar.gz.

File metadata

  • Download URL: piglet_templates-1.3.3.tar.gz
  • Upload date:
  • Size: 51.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for piglet_templates-1.3.3.tar.gz
Algorithm Hash digest
SHA256 2efbc65ab91024fe96ebfc93cdfe0772e9f72004bcee9cd34aef82a47d64867c
MD5 d780fdee8e3ba526681d38bf8981eac2
BLAKE2b-256 c7c974b012f7338f8c3a368da93bb4f710783042f8e75598c7def66dd5080fd9

See more details on using hashes here.

File details

Details for the file piglet_templates-1.3.3-py3-none-any.whl.

File metadata

File hashes

Hashes for piglet_templates-1.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cd583bd398d52057ffd87f31c2ee29aef9042a72c44e1405c41a305a74f6f6dc
MD5 7388daee6482e12b7fd92f9548ccc7c0
BLAKE2b-256 c48f6cc4216f8a6870c5555b2617214304b82a2617048e27575dc987607f20af

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page