By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,885 Members | 1,499 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,885 IT Pros & Developers. It's quick & easy.

Simple HTML template engine?

P: n/a
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

Oct 15 '07 #1
Share this Question
Share on Google+
17 Replies


P: n/a
allen.fowler wrote:
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
Oct 15 '07 #2

P: n/a
"allen.fowler" <al**********@yahoo.comwrote in
news:11**********************@e9g2000prf.googlegro ups.com:
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

Oct 15 '07 #3

P: n/a
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.
On 10/15/07, allen.fowler <al**********@yahoo.comwrote:
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
Oct 15 '07 #4

P: n/a
allen.fowler wrote:
Hello,

Can anyone recommend a simple python template engine for generating
HTML that relies only on the Pyhon Core modules?
Mako (http://www.makotemplates.org/) sounds like what you want..

Will McGugan
http://www.willmcgugan.com
Oct 15 '07 #5

P: n/a
allen.fowler wrote:
Hello,

Can anyone recommend a simple python template engine for generating
HTML that relies only on the Pyhon Core modules?
Mako (http://www.makotemplates.org/) sounds like what you want..

Will McGugan
http://www.willmcgugan.com
Oct 15 '07 #6

P: n/a
Ivo
Ciprian Dorin Craciun wrote:
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.
On 10/15/07, allen.fowler <al**********@yahoo.comwrote:
>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
I concur completely!
My site http://IvoNet.nl is completely written in python and based on a
very early release of cherrypy.

gr,
Ivo.
Oct 15 '07 #7

P: n/a
CherryPy looks nice... though I am just looking to generate static
reports.

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

On Oct 15, 4:38 am, "Ciprian Dorin Craciun"
<ciprian.crac...@gmail.comwrote:
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.
Oct 16 '07 #8

P: n/a
In article <11**********************@e9g2000prf.googlegroups. com>,
"allen.fowler" <al**********@yahoo.comwrote:
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

--
Philip
http://NikitaTheSpider.com/
Whole-site HTML validation, link checking and more
Oct 16 '07 #9

P: n/a
On Oct 15, 1:26 am, John Nagle <na...@animats.comwrote:
allen.fowler wrote:
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

This look exactly like what I need.

Google first led me to the "HTML::Template" perl library.

But now i've got the right one at: http://freespace.virgin.net/hamish.s...ltemplate.html

Thank you.

Oct 16 '07 #10

P: n/a
On Oct 15, 1:26 am, John Nagle <na...@animats.comwrote:
allen.fowler wrote:
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
Thanks...
Wait a sec... this is a Perl module...

Am I missing something? :)
Allen

Oct 16 '07 #11

P: n/a
CherryPy looks nice... though I am just looking to generate static
reports.

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

On Oct 15, 4:38 am, "Ciprian Dorin Craciun"
<ciprian.crac...@gmail.comwrote:
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.
Oct 16 '07 #12

P: n/a
allen.fowler wrote:
>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
Oct 16 '07 #13

P: n/a
On Oct 16, 4:07 am, jean-michel bain-cornu <nos...@nospam.frwrote:
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.
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

Oct 16 '07 #14

P: n/a
Adrian Cherry a écrit :
"allen.fowler" <al**********@yahoo.comwrote in
news:11**********************@e9g2000prf.googlegro ups.com:

>>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?
Did you read the OP's question ?-)
Oct 16 '07 #15

P: n/a
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...
Oct 16 '07 #16

P: n/a
This one is really small and simple (one small file):

http://davidbau.com/archives/2007/02...templates.html

"allen.fowler" <al**********@yahoo.comwrote in message
news:11**********************@e9g2000prf.googlegro ups.com...
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

Oct 17 '07 #17

P: n/a
Bruno Desthuilliers <bd*****************@free.quelquepart.fr>
wrote in news:47***********************@news.free.fr:
>
Did you read the OP's question ?-)
Yup, as much as anyone else has. Why?

Adrian

Oct 17 '07 #18

This discussion thread is closed

Replies have been disabled for this discussion.