[ANN] pyTenjin 0.6.2 - a fast and full-featured template engine

M

makoto kuwata

I have released pyTenjin 0.6.2.
http://www.kuwata-lab.com/tenjin/
This is a tiny bug fix release.

pyTenjin is the fastest template engine for Python.
Not only very fast, but also full-featured and easy-to-use is
pyTenjin.
You can embed Python statements and expressions into your text file.
Tenjin converts it into Python program and evaluate it.

Features:
* very fast
- x2 faster than Mako
- x3 faster than Cheetah and Myghty
- x9 faster than Django
- x60 faster than Kid
* Full-featured
- layout template
- partial template
- capturing
- preprocessing
- and so on...

You can see the detail of benchmark at:
http://www.kuwata-lab.com/tenjin/
(benchmark script is included in pyTenjin distribution.)


Installation:

$ easy_install Tenjin
## or download, extract, and execute 'setup.py'


Example: template.pyhtml

<h1>${title}</h1>
<ul>
<?py for item in items: ?>
<li>${item}
#{item}</li>
<?py #end ?>
</ul>

Example: main.py

import tenjin
from tenjin.helpers import to_str, escape
engine = tenjin.Engine()
context = { 'title': 'pyTenjin Example',
'items': ['<AAA>', 'B&B', '"CCC"'] }
output = engine.render('template.pyhtml', context)
print output,

Example: result

$ python main.py
<h1>pyTenjin Example</h1>
<ul>
<li>&lt;AAA&gt;
<AAA></li>
<li>B&amp;B
B&B</li>
<li>&quot;CCC&quot;
"CCC"</li>
</ul>


See user's guide and examples at the above page for details.
New release of pyTenjin will be informed at:
http://www.kuwata-lab.com/support/


Release 0.6.2:

[Changes]

* When '-S', '-a retrieve', '-X', or '-a statements' specified,
pytenjin command replaces text before expressions into spaces
and print it.

[Bugfix]

* pytenjin command printed "\n\n" instead of "\n" when '-U'
specified.
Fixed to print "\n".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,189
Members
46,735
Latest member
HikmatRamazanov

Latest Threads

Top