Re: Python script for checking pairwise characters (PROFF-OF-CONCEPT)

Timothy Allen <[email protected]>
Newsgroups gmane.comp.literature.sword.devel
Message-ID <[email protected]>
On 19/12/23 01:45, Matěj Cepl wrote:
> 2. I use SAX API (xml.sax from the standard library) and it seems
>     to me like better suited for the Bible processing than the
>     traditional DOM (or LXML) interface. It nicely hides away all
>     hard work going on in the background and let me work only on
>     what’s relevant to my task.

As a data point, when I was writing scripts for manipulating and 
updating the BSB module, I found the `xml.etree.ElementTree` module in 
the Python standard library to be many times faster than the SAX API. 
The SAX API is a perhaps a bit more convenient, because you can just 
subscribe to whatever events are meaningful for whatever processing you 
want to do, but ElementTree is just so much faster I found it was worth it.

LXML is probably faster again, but that's a third-party dependency, and 
that adds enough hassle for people who aren't Python developers that I 
drew the line there.

If you've already written things using the SAX API that work well for 
you, there's probably no point rewriting them, but if you're writing 
more tools in the future, you might want to give it a try!


Timothy

_______________________________________________
sword-devel mailing list: [email protected]
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.