What library/package to use for parsing XML?
cl at isbd.net
Tue Jan 31 03:52:22 EST 2017
Irmen de Jong <irmen.NOSPAM at xs4all.nl> wrote:
> On 30-1-2017 18:58, Chris Green wrote:
> > I want to parse some XML data, it's the address book data from the
> > linux program osmo. The file I want to parse is like this:-
> > I basically want to be able to extract the data and output in other
> > formats - e.g. write to a Sqlite3 database and/or CSV.
> > So what do I need to import (and probably install first) to do this?
> No need to install anything. Python has batteries included.
> Parse your XML with xml.etree.ElementTree
> Read/write CSV with csv
> Put stuff in sqlite3 database and query it using sqlite3
Thanks, it was the ElementTree bit I didn't know. Searching for
'Python XML' produces so many hits it's difficult to see what's
More information about the Python-list