nkanaev / misai

misai is a simple template engine for the Python programming language. It’s loosely inspired by Jinja and mustache. Sample code is shown below:

{{ #if logged_in }}
    {{ #for user : users }}
        {{ "Hello: " | concat: user.name }}
    {{ #end }}
{{ #end }}

“misai” means moustache in Malay, due to heavy use of curly braces.

misai features:

The project is under 500 LOC, and comes with no external dependencies. It implements a context sensitive lexer and a one-pass compiler that transforms template to Python bytecode internally.

misai is currently used to render a web version of 101 Zen Stories, a collection of stories compiled by Nyogen Senzaku in the early 20th century.

Source code: https://github.com/nkanaev/misai