et-xmlfile

2.0.0 · active · verified Sat Mar 28

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.

Warnings

Install

Imports

Quickstart

A minimal example demonstrating how to use et-xmlfile to create an XML file in memory.

from io import BytesIO
from xml.etree.ElementTree import Element
from et_xmlfile import xmlfile

out = BytesIO()
with xmlfile(out) as xf:
    el = Element('root')
    xf.write(el)

assert out.getvalue() == b'<root />'

view raw JSON →