Templite -- A light-weight, fully functional, general purpose templating engine, allowing you to embed python code directly into your text. This engine is suitable for any templating (not only HTML/XML), and is minimal (40 lines of code!) and fast (all preprocessing is done in "compile time")

All text between ${ and }$ is considered python code, and is evaluated when the Templite is rendered. You can escape the ${ delimiter by $\{ and the }$ delimiter by }\$ .

Emitting output is done with the emit() function, which accepts any number of arguments, converts them to a string, and appends to the output where the template was located.

Security notice: IT'S NOT SECURE, as the template-generating code is arbitrary python code. So be sure you don't just evaluate user-provided Templites, at least not before taking a look at them. It's meant to be a light and fast templating engine, for trusted server side code (generating reports, etc.).