Python XML and tables using math

Stefan Behnel stefan_ml at behnel.de
Mon Aug 16 02:00:30 EDT 2010


flebber, 16.08.2010 05:30:
> I am looking at a project that will import and modify an XML file and
> then export it to a table. Currently a flat file table system should
> be fine.
>
> I want to export the modified data to the table and then perform a
> handful of maths(largely simple statistical functions) to the data and
> then print out the resultant modified tables.
>
> I was planning on using Python 2.7 for the project.
>
> Has anyone used a guide to acheive something similar? I would like to
> read up on it so I can assess my options and best methods, any hints
> or tips?

That can usually be done in a couple of lines in Python. The approach I 
keep recommending is to use cElementTree (in the stdlib), potentially its 
iterparse() function if the file is too large to easily fit into memory, 
but the code won't change much either way.

You might want to skip through this list a bit, similar questions have been 
coming up every couple of weeks. The responses often include mostly 
complete implementations that you can borrow from.

Stefan




More information about the Python-list mailing list