For real, lxml is the best xml parser python has for big files. ElementTree is fine for small stuff but falls apart with scale.
Memory issues? Use streaming parsers like `iterparse` or even `xml.sax`. They’re not as convenient but won’t crash your script.
Also, if you’re on Linux, `xmllint` (command line) can help pre-process files before parsing. Not pure Python, but sometimes the hack works.
Memory issues? Use streaming parsers like `iterparse` or even `xml.sax`. They’re not as convenient but won’t crash your script.
Also, if you’re on Linux, `xmllint` (command line) can help pre-process files before parsing. Not pure Python, but sometimes the hack works.
