recommended general-purpose string template packages?

Discussion in 'Python' started by John Machin, Aug 14, 2006.

  1. John Machin

    John Machin Guest

    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
     
    John Machin, Aug 14, 2006
    #1
    1. Advertising

  2. John Machin

    Ravi Teja Guest

    > 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
     
    Ravi Teja, Aug 14, 2006
    #2
    1. Advertising

  3. John Machin

    metaperl Guest

    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
     
    metaperl, Aug 14, 2006
    #3
  4. John Machin

    Yu-Xi Lim Guest

    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.
     
    Yu-Xi Lim, Aug 14, 2006
    #4
  5. John Machin

    Dan Sommers Guest

    On 13 Aug 2006 19:48:55 -0700,
    "John Machin" <> 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
     
    Dan Sommers, Aug 15, 2006
    #5
  6. John Machin

    vj Guest

    vj, Aug 15, 2006
    #6
  7. John Machin

    metaperl Guest

    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.
     
    metaperl, Aug 16, 2006
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert Bj?rn
    Replies:
    0
    Views:
    428
    Robert Bj?rn
    Jun 1, 2004
  2. Maarten van Reeuwijk

    Looking for very simple general purpose tokenizer

    Maarten van Reeuwijk, Jan 19, 2004, in forum: Python
    Replies:
    6
    Views:
    393
  3. Ron Stephens
    Replies:
    23
    Views:
    2,930
    Ron Stephens
    Apr 12, 2004
  4. Donald Newcomb

    NEWB: General purpose list iteration?

    Donald Newcomb, Aug 12, 2005, in forum: Python
    Replies:
    4
    Views:
    323
    Donald Newcomb
    Aug 12, 2005
  5. Dexter

    General purpose Expression Parser

    Dexter, Mar 20, 2008, in forum: C Programming
    Replies:
    33
    Views:
    1,025
    Kenny McCormack
    Mar 22, 2008
Loading...

Share This Page