Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > recommended general-purpose string template packages?

Reply
Thread Tools

recommended general-purpose string template packages?

 
 
John Machin
Guest
Posts: n/a
 
      08-14-2006
Hi,

In general, I'm mainly interested in a template engine for dynamic web
pages but would like a general purpose one to avoid learning yet
another package for generating e-mail messages, form letters, source
code, whatever.

In particular, does anyone have much experience with the Python
interface to Terence Parr's StringTemplate
(http://www.stringtemplate.org/)? Reading the website, I'm attracted by
the approach, but a Google search (both generally and in this
newsgroup) gives me the impression that it's little used in the Python
world.

TIA,
John

 
Reply With Quote
 
 
 
 
Ravi Teja
Guest
Posts: n/a
 
      08-14-2006
> In general, I'm mainly interested in a template engine for dynamic web
> pages but would like a general purpose one to avoid learning yet
> another package for generating e-mail messages, form letters, source
> code, whatever.
>
> In particular, does anyone have much experience with the Python
> interface to Terence Parr's StringTemplate
> (http://www.stringtemplate.org/)? Reading the website, I'm attracted by
> the approach, but a Google search (both generally and in this
> newsgroup) gives me the impression that it's little used in the Python
> world.


Most Python templating engines are general purpose. Choice between them
however is sometimes a matter of preference, like editors. I settled
down on Cheetah for most part.

Here is a list of some popular ones.
http://wiki.python.org/moin/Templating

 
Reply With Quote
 
 
 
 
metaperl
Guest
Posts: n/a
 
      08-14-2006

John Machin wrote:
> Hi,
>
> In general, I'm mainly interested in a template engine for dynamic web
> pages but would like a general purpose one to avoid learning yet
> another package for generating e-mail messages, form letters, source
> code, whatever.


HTMLTemplate and texttemplate offer a somewhat uniform approach to text
versus HTML... it attempts to raise string processing up to the level
of tree/HTML processing. That stringtemplate module seems to be aiming
for the lowest common denominator.

Interesting contrast in approaches:
http://freespace.virgin.net/hamish.sanderson/index.html

 
Reply With Quote
 
Yu-Xi Lim
Guest
Posts: n/a
 
      08-14-2006
Ravi Teja wrote:
> Most Python templating engines are general purpose. Choice between them
> however is sometimes a matter of preference, like editors. I settled
> down on Cheetah for most part.


I second Cheetah. It's suitable for most text templates. Many others are
specific for XML or HTML documents.
 
Reply With Quote
 
Dan Sommers
Guest
Posts: n/a
 
      08-15-2006
On 13 Aug 2006 19:48:55 -0700,
"John Machin" <(E-Mail Removed)> wrote:

> In general, I'm mainly interested in a template engine for dynamic web
> pages but would like a general purpose one to avoid learning yet
> another package for generating e-mail messages, form letters, source
> code, whatever.


And don't forget Python's Template class:

http://docs.python.org/lib/node109.html

Regards,
Dan

--
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people would die in alphabetical order." -- My wife, the genealogist
 
Reply With Quote
 
vj
Guest
Posts: n/a
 
      08-15-2006
I use preppy from reportlab:

http://www.reportlab.org/preppy.html

It's one file, is fast and can be easily embedded in any application.

Vineet

 
Reply With Quote
 
metaperl
Guest
Posts: n/a
 
      08-16-2006

vj wrote:
> I use preppy from reportlab:
>
> http://www.reportlab.org/preppy.html


wow. thanks for the link. I second you on pretty. It is ultra-simple
and nothing but a gateway to python.

also, reportlab makes a number of high-quality open source python
wares.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
r H2 deduce deduce template argument of a template class inheritingfrom a non template base? nguillot C++ 5 03-08-2009 05:56 PM
How to use the template member function of a template in the memberfunction of another template class? Peng Yu C++ 3 10-26-2008 03:51 PM
template template arguments: expected a class template, got `Component<T1, T2, T3> gary.bernstein@gmail.com C++ 1 06-08-2007 07:10 AM
Re: A Newbie Question about template template template tom_usenet C++ 0 07-24-2003 12:06 PM
Re: A Newbie Question about template template template Chris Theis C++ 2 07-24-2003 09:42 AM



Advertisments