Simple HTML template engine?

A

allen.fowler

Hello,

Can anyone recommend a simple python template engine for generating
HTML that relies only on the Pyhon Core modules?

No need for caching, template compilation, etc.

Speed is not a major issue.

I just need looping and conditionals. Template inheritance would be a
bonus.

I've seen Genshi and Cheetah, but they seem way too complex.

Any ideas?

I'm sure I could build something myself, but I'm sure this has already
been done quite a few times. Why re-invent the wheel, right?


Thank you,
Allen
 
J

John Nagle

allen.fowler said:
Hello,

Can anyone recommend a simple python template engine for generating
HTML that relies only on the Pyhon Core modules?

No need for caching, template compilation, etc.

Speed is not a major issue.

I just need looping and conditionals. Template inheritance would be a
bonus.

HTMLTemplate is a minimal system for that sort of thing.
It doesn't drag in some big "framework".

John Nagle
 
A

Adrian Cherry

Hello,

Can anyone recommend a simple python template engine for
generating HTML that relies only on the Pyhon Core modules?

No need for caching, template compilation, etc.

Speed is not a major issue.

I just need looping and conditionals. Template inheritance
would be a bonus.

I've seen Genshi and Cheetah, but they seem way too complex.

Any ideas?

Did you try Cheetah? I've just started using it for a simple job,
just looping and conditionals and it seemed quite simple to me.

Adrian
 
C

Ciprian Dorin Craciun

Have you tried CherryPy? http://www.cherrypy.org/

It's not a template engine, but a simple web server engine, and
you could code your conditionals and loops directly in Python... When
I have tried it, it looked very nice and easy.

Ciprian.
 
I

Ivo

Ciprian said:
Have you tried CherryPy? http://www.cherrypy.org/

It's not a template engine, but a simple web server engine, and
you could code your conditionals and loops directly in Python... When
I have tried it, it looked very nice and easy.

Ciprian.

I concur completely!
My site http://IvoNet.nl is completely written in python and based on a
very early release of cherrypy.

gr,
Ivo.
 
A

allen.fowler

CherryPy looks nice... though I am just looking to generate static
reports.

Thanks anyway... I'll keep it in mind for the future.
 
N

Nikita the Spider

"allen.fowler said:
Hello,

Can anyone recommend a simple python template engine for generating
HTML that relies only on the Pyhon Core modules?

No need for caching, template compilation, etc.

Speed is not a major issue.

I just need looping and conditionals. Template inheritance would be a
bonus.

I've seen Genshi and Cheetah, but they seem way too complex.

I use Spyce, but in addition to being a template system for mixing
Python & HTML, it is also a Web server which drags in a bunch of extra
cruft that you don't need. It's what I use to generate static reports,
though.

Good luck
 
A

allen.fowler

HTMLTemplate is a minimal system for that sort of thing.
It doesn't drag in some big "framework".

John Nagle

Thanks...
Wait a sec... this is a Perl module...

Am I missing something? :)


Allen
 
A

allen.fowler

CherryPy looks nice... though I am just looking to generate static
reports.

Thanks anyway... I'll keep it in mind for the future.
 
D

Dennis Lee Bieber

CherryPy looks nice... though I am just looking to generate static
reports.
Don't recall if CherryTemplate is still supported/developed
(TurboGears seems to have picked up CherryPy for the server, but did not
use CherryTemplate for the HTML template scheme)
--
Wulfraed Dennis Lee Bieber KD6MOG
(e-mail address removed) (e-mail address removed)
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: (e-mail address removed))
HTTP://www.bestiaria.com/
 
J

jean-michel bain-cornu

Can anyone recommend a simple python template engine for generating
HTML that relies only on the Pyhon Core modules?

No need for caching, template compilation, etc.

Speed is not a major issue.

I just need looping and conditionals. Template inheritance would be a
bonus.

I have written my own a couple of years ago. It is very simple (just one
script with no dependancies) and doesn't offer conditionals and inheritance.
The documentation is here : http://www.jmbc.fr/balloondoc/index.html
and you can download at :
http://sourceforge.net/project/showfiles.php?group_id=162003

I hope this will be helpful.
jm
 
G

Gerardo Herzig

allen.fowler said:
Hello,

Can anyone recommend a simple python template engine for generating
HTML that relies only on the Pyhon Core modules?

No need for caching, template compilation, etc.

Speed is not a major issue.

I just need looping and conditionals. Template inheritance would be a
bonus.

I've seen Genshi and Cheetah, but they seem way too complex.

Any ideas?

I'm sure I could build something myself, but I'm sure this has already
been done quite a few times. Why re-invent the wheel, right?


Thank you,
Allen
http://htmltmpl.sourceforge.net/

It has loops and conditionals, simple to use. Very simple.
Kind of old program (dont seems to have suffer modifications since 2001)

Try it.
Cheers.

Gerardo
 
C

Carl Banks

I have written my own a couple of years ago.

Haven't we all.

When I wrote mine (HRL), the 5 million web page systems out there
seemed all to be either:

A. Intricate frameworks like Zope with a maniacal insistence on
separation of content from presentation (not that that's bad, it's
just a lot of unnecessary overhead for my needs).

or

B. Template systems with very little versatility.

These days there seems to be more coverage of different needs. For
instance, Mako looks like something I might have used if it had been
around back then.


Carl Banks
 
J

jean-michel bain-cornu

These days there seems to be more coverage of different needs. For
instance, Mako looks like something I might have used if it had been
around back then.
It's probably the same to me.
And many times, the simple python templating system %(var)s is good
enough...
 

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,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top