Python/HTML integration: phileas v0.3 released
hippostech at gmail.com
Fri Nov 20 14:18:06 CET 2009
On 20 nov, 09:02, Stefan Behnel <stefan... at behnel.de> wrote:
> papa hippo, 19.11.2009 19:53:
> > The prime goal of 'phileas' is to enable html code to be seamlessly
> > included in python code in a natural looking syntax, without resorting
> > to templatng language.
> I assume you know XIST, ElementTree's ElementMaker, and all those other
> ways of generating XML/HTML from Python code in a natural looking way?
Thanks for your feedback.
Yes, I am aware that phileas might - on the basis of the short
description on this post - come across like a 're-invented wheel'.
There is, however, one big difference between phileas and all other
other similar packages (XIST, ELementTree, HTMLgen, HyperText,
pyhtmloo etc.) that I inspected:
Phileas uses distinct objects to generate each start and end tag,
whereas all the others use a single function call (in some cases
itself generated by a function call) to generate a complete well-
formed element including start-tag and (where required) end-tag. In
theory this is less neat and indeed it means one can write 'bad' HTML
(e.g. missing end of paragraphs) with phileas just as easily as when
writing pure html. In practice, however, I find it at a lot easier to
While using pyhtmloo (my previous favourite HTML generator), I had
found myself using awkward complicated artificial constructions in
order to generate all but the simplest HTML - and spent much time
playing 'hunt the missing bracket'. With phileas, these complexities
seem to just fall away.
Put another way, Phileas generates HTML4.0 - warts and all; it is not
a parser or generator of XML.
I'm considering building in checks/warnings for unclosed elements
etc., probably in the next-but-one pre-release.
More information about the Python-list