<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 19/12/23 01:45, Matěj Cepl wrote:<span
style="white-space: pre-wrap">
</span></div>
<blockquote type="cite"
cite="mid:CXRJH87HS689.3R76HPD4QS6XW@cepl.eu">
<pre class="moz-quote-pre" wrap="">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.</pre>
</blockquote>
<p>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.</p>
<p>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.</p>
<p>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!</p>
<p><br>
</p>
<p>Timothy<br>
</p>
</body>
</html>