Cheetah is an open source template engine and code-generation tool written in Python. Cheetah can be used unto itself, or incorporated with other technologies and stacks regardless of whether they’re written in Python or not.
At its core, Cheetah is a domain-specific language for markup generation and templating which allows for full integration with existing Python code but also offers extensions to traditional Python syntax to allow for easier text-generation.
You can get involved and talk with Cheetah developers on the Cheetah mailing list (cheetahtemplate-discuss@lists.sourceforge.net) or on the IRC channel: #cheetah on Freenode
Below is a simple example of some Cheetah code, as you can see it’s practically Python. You can import, inherit and define methods just like in a regular Python module, since that’s what your Cheetah templates are compiled to :)
#from Cheetah.Template import Template
#extends Template
#set $people = [{'name' : 'Tom', 'mood' : 'Happy'}, {'name' : 'Dick',
'mood' : 'Sad'}, {'name' : 'Harry', 'mood' : 'Hairy'}]
<strong>How are you feeling?</strong>
<ul>
#for $person in $people
<li>
$person['name'] is $person['mood']
</li>
#end for
</ul>