Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Simple HTML templating for Python

Project Description

Simple HTML templating for Python

from lys import L

print(L.body / (
    L.h1 / 'What is love ?',
    L.ul / ( / 'Something in the air', / 'You can\'t catch it', / (
            L.a(href="") / 'Keep trying'

To install, pip3 install lys

A few more tricks:

# raw() to mark the content as already escaped
from lys import raw
L.p / raw('<script>alert("boo")</script>')

# attributes '_' are replaced with '-'
L.button(data_id="123") / 'click me'
# => <button data-id="123">click me</button>

# shortcut to add classes and ids easily
L.button('#magic-button.very-big', onclick='add_it()') / 'Magic !'

Inspiration : pyxl, React

Release History

This version
History Node


History Node


Download Files

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

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(3.3 kB) Copy SHA256 Hash SHA256
Source Sep 6, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting