Python/HTML integration: phileas v0.3 released

P

papa hippo

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.

see:

http://larry.myerscough.nl/phileas_project/

I intend to submit phileas to the python.announce forum within the
next few days. Any feedback received now will be gratefully received
and may lead to improved quality of that submission.


Larry Myerscough
Eindhoven NL
(e-mail address removed)
 
S

Steve Howell

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.

see:

http://larry.myerscough.nl/phileas_project/

I intend to submit phileas to the python.announce  forum within the
next few days. Any feedback received now will be gratefully received
and may lead to improved quality of that submission.

Hi Larry, looks like interesting stuff!

There appears to be a problem with this page:

http://larry.myerscough.nl/show_python_source.py?script_filename=./MyPage..py

IOError: [Errno 2] No such file or directory: './MyPage.py'

I do like the idea of having a more Python-oriented way to generate
HTML.
 
S

Stefan Behnel

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?

Stefan
 
D

Daniel Fetchinson

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.

see:

http://larry.myerscough.nl/phileas_project/

I intend to submit phileas to the python.announce forum within the
next few days. Any feedback received now will be gratefully received
and may lead to improved quality of that submission.

Hi Larry, looks like interesting stuff!

There appears to be a problem with this page:

http://larry.myerscough.nl/show_python_source.py?script_filename=./MyPage.py

IOError: [Errno 2] No such file or directory: './MyPage.py'

I do like the idea of having a more Python-oriented way to generate
HTML.

Have you guys considered markup.py from http://markup.sourceforge.net/
? It's comparable to your project as far as I can see, a more detailed
comparison would probably be useful.

Cheers,
Daniel
 
P

papa hippo

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 intend to submit phileas to the python.announce  forum within the
next few days. Any feedback received now will be gratefully received
and may lead to improved quality of that submission.

Hi Larry, looks like interesting stuff!

There appears to be a problem with this page:

http://larry.myerscough.nl/show_python_source.py?script_filename=./My....

IOError: [Errno 2] No such file or directory: './MyPage.py'
Oh dear! my blunder; While syncing (with meld) from my test
environment to the live environment, I missed a file. It seems to be
fixed now.
I do like the idea of having a more Python-oriented way to generate
HTML.

That's good to hear.


Larry
 
P

papa hippo

papa hippo, 19.11.2009 19:53:


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?

Stefan

Hi Stefan,

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

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.

Larry
 
J

J Kenneth King

papa hippo said:
Hi Stefan,

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

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.

Any decent editor should be able to balance parenthesis for you.
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.

That your library will require a validation to be executed at run-time
seems like it will be tedious to use.

A decent text editor can even balance your HTML tags for you.

Though you have a neat "DSL" like language for representing HTML
elements. I'd suggest taking it one step further and creating a
machine that can read in a Python data-structure and with as few hints
as possible wrap it in the appropriate tags.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,183
Messages
2,570,969
Members
47,524
Latest member
ecomwebdesign

Latest Threads

Top