Skip to main content

Python HTML Generator for Recyclable Web Elements

Project description


Python HTML Generator for Recyclable Web Elements.

Tumulus is an alternative to Templating languages found in many templating engines such as Jinja2, Django, Mako, ...
Such templating engines make it difficult to separate logical elements of the page, hence discouraging reusability.

The motivation behind Tumulus is to encourage developers to build reusable web components that can then be
put together to build web pages or applications.


# Importing the basic brick of Tumulus, the tags creator:
from tumulus.tags import tags as t
# This module helps to add JS/CSS libraries in page head/footer:
import tumulus.lib as lib

def bootstrap_button(text):
'''Returns a Bootstrap formatted button, and adds the CSS of
Bootstrap to the dependencies of the page.'''
return t.div(
# Standard HTML button with 'text' inside:
t.button(text, class_='btn btn-info'),
# Injecting Bootstrap's CSS file in the HTML head.
# This can be done almost anywhere, as it will be included
# somewhere else, and there is de-duplication.

def page(title, text):
return t.html(
bootstrap_button('Click Here'),

page('Hello World', 'Hello from Tumulus').build()

Run tests

Tumulus uses testing intensely, and tries to keep a coverage close from 100%. Testing
is done using `pytest` and `pytest-cov`.

Run all tests:
py.test tumulus

Generate a coverage report:
py.test --cov tumulus && coverage html

Project details

Download files

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

Files for Tumulus, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size Tumulus-0.2.1.tar.gz (7.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page