A low-memory library for creating large XML files, implementing lxml's xmlfile module for the standard library. Current version: 2.0.0, released on October 25, 2024. Maintained by CharlieX. Requires Python 3.8 or higher. Release cadence: approximately every 3 years.
pip install et-xmlfileVerified import paths — ran on the pinned version, not inferred.
A minimal example demonstrating how to use et-xmlfile to create an XML file in memory.
Avoid using the .element() method; instead, create Elements and write them directly.
Avoid running pip as the 'root' user; instead, use a virtual environment for package installation or run pip as a non-root user.
It is recommended to use a virtual environment instead (https://pip.pypa.io/warnings/venv). Alternatively, use the --root-user-action option if you understand the implications and wish to suppress this warning.
Install the library using pip: `pip install et-xmlfile`
Ensure you are calling methods like `write()` or `element()` on the `xmlfile` object for streaming, and manipulate `xml.etree.ElementTree.Element` objects for their attributes (like `tag` or `text`) before writing them.
Ensure that the argument passed to `write()` is an `xml.etree.ElementTree.Element` instance as shown in examples, or a string if writing raw XML data, and matches the expected type of the underlying output stream (e.g., `BytesIO` expects bytes, regular file objects might expect strings).
No dependency data recorded yet.