Skip to main content
coverage status

et_xmfile

XML can use lots of memory, and et_xmlfile is a low memory library for creating large XML files And, although the standard library already includes an incremental parser, iterparse it has no equivalent when writing XML. Once an element has been added to the tree, it is written to the file or stream and the memory is then cleared.

This module is based upon the xmlfile module from lxml with the aim of allowing code to be developed that will work with both libraries. It was developed initially for the openpyxl project, but is now a standalone module.

The code was written by Elias Rabel as part of the Python Düsseldorf openpyxl sprint in September 2014.

Proper support for incremental writing was provided by Daniel Hillier in 2024

Note on performance

The code was not developed with performance in mind, but turned out to be faster than the existing SAX-based implementation but is generally slower than lxml’s xmlfile. There is one area where an optimisation for lxml may negatively affect the performance of et_xmfile and that is when using the .element() method on the xmlfile context manager. It is, therefore, recommended simply to create Elements write these directly, as in the sample code.

Release files for et-xmlfile 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for et-xmlfile 2.0.0
File Size Uploaded
et_xmlfile-2.0.0.tar.gz 17.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for et-xmlfile 2.0.0
File Interpreter ABI Platform
et_xmlfile-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 35.3 kB

Release files / et_xmlfile-2.0.0.tar.gz

Download URL et_xmlfile-2.0.0.tar.gz
Size 17.2 kB
Tags Source
SHA-256 checksum
How to use checksums
dab3f4764309081ce75662649be815c4c9081e88f0837825f90fd28317d4da54
BLAKE2b-256 checksum
How to use checksums
d338af70d7ab1ae9d4da450eeec1fa3918940a5fafb9055e934af8d6eb0c2313
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.15

Release files / et_xmlfile-2.0.0-py3-none-any.whl

Download URL et_xmlfile-2.0.0-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a91720bc756843502c3b7504c77b8fe44217c85c537d85037f0f536151b2caa
BLAKE2b-256 checksum
How to use checksums
c18b5fe2cc11fee489817272089c4203e679c63b570a5aaeb18d852ae3cbba6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.15

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.1.0

2 release files

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page