Suba is a very fast template engine for Python 3k.
Python
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
benchmark
test
.gitignore
README
suba.py

README

Suba
----
Author: Jesse Dailey <jesse.dailey@gmail.com>

Suba (suhb-uh) is a fast template engine.

Inspired by python's Mod (%) operator's string substitution.

>>> template(text="This is a test of %(who)s.", who="Suba")
'This is a test of Suba.'

Unlike the Mod operator, you can include ANY valid python as the substitution expression, not just key names.

>>> template(text="These are numbers: %( " ".join((x+x for x in range(1,10))) )s")
'These are numbers: 2 4 6 8 10 12 14 16 18'

See the extensive doctests in suba.py, and the test/ folder.

For a speed comparison, look in the benchmark/ folder.