ANN: CherryTemplate-1.0.0 released

R

Remi Delon

Hello everyone,

I'm happy to announce the first release of CherryTemplate, an easy and
powerful templating system in python.

Note that it is not "yet another templating system" because it used to
be part of CherryPy, but is now released as a standalone package.

Basically, you use it like this:

$ python
Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)]
on win32
Type "help", "copyright", "credits" or "license" for more information.'Hello, world'

The language only has a few tags: py-eval, py-exec, py-code, py-if,
py-for, py-include but it is quite powerful because most of python's
power is still available from the template:
- "py-for" allows you to do things like <py-for="i,j in [(0,0),
(1,2), (3,1)]">
- "py-code" allows you to insert full blocks of pure python code
inside your template (it takes care of the indentation for you)

CherryTemplate can also render external templates (ex:
renderTemplate(file = 'template.html')) and has full unicode support.

Once nice feature about it is that is uses generators to render your
template, so if you need to process a large amount of data you can
tell it to return a generator, and then you can loop through it. This
way it doesn't use up too much memory. Here is an example:
'i:'
'0'
'i:'
'1'
'i:'
'2'
'i:'
'3'
'i:'
'4'

You can find more information (including the download link) on this
page: http://trac.cherrypy.org/cgi-bin/trac.cgi/wiki/CherryTemplate

Remi.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top