Simple HTML template engine?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • allen.fowler

    Simple HTML template engine?

    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

  • John Nagle

    #2
    Re: Simple HTML template engine?

    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

    Comment

    • Adrian Cherry

      #3
      Re: Simple HTML template engine?

      "allen.fowl er" <allen.fowler@y ahoo.comwrote in
      news:1192419411 .895715.138450@ e9g2000prf.goog legroups.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

      Comment

      • Ciprian Dorin Craciun

        #4
        Re: Simple HTML template engine?

        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 <allen.fowler@y ahoo.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

        Comment

        • Will McGugan

          #5
          Re: Simple HTML template engine?

          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

          Comment

          • Will McGugan

            #6
            Re: Simple HTML template engine?

            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

            Comment

            • Ivo

              #7
              Re: Simple HTML template engine?

              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 <allen.fowler@y ahoo.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.

              Comment

              • allen.fowler

                #8
                Re: Simple HTML template engine?

                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.comwrot e:
                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.

                Comment

                • Nikita the Spider

                  #9
                  Re: Simple HTML template engine?

                  In article <1192419411.895 715.138450@e9g2 000prf.googlegr oups.com>,
                  "allen.fowl er" <allen.fowler@y ahoo.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

                  Whole-site HTML validation, link checking and more

                  Comment

                  • allen.fowler

                    #10
                    Re: Simple HTML template engine?

                    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.

                    Comment

                    • allen.fowler

                      #11
                      Re: Simple HTML template engine?

                      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

                      Comment

                      • allen.fowler

                        #12
                        Re: Simple HTML template engine?

                        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.comwrot e:
                        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.

                        Comment

                        • Gerardo Herzig

                          #13
                          Re: Simple HTML template engine?

                          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
                          >
                          >
                          >


                          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

                          Comment

                          • Carl Banks

                            #14
                            Re: Simple HTML template engine?

                            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

                            Comment

                            • Bruno Desthuilliers

                              #15
                              Re: Simple HTML template engine?

                              Adrian Cherry a écrit :
                              "allen.fowl er" <allen.fowler@y ahoo.comwrote in
                              news:1192419411 .895715.138450@ e9g2000prf.goog legroups.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 ?-)

                              Comment

                              Working...