---
title: "et-xmlfile | pypx"
description: "An implementation of lxml.xmlfile for the standard library"
canonical_url: "https://pypx.app/packages/et-xmlfile"
meta:
  "og:description": "An implementation of lxml.xmlfile for the standard library"
  "og:image": "https://pypx.app/_og/d/h_630%2Cc_PackageCard%2Cname_et-xmlfile%2Cversion_2.0.0%2Csummary_An%2Bimplementation%2Bof%2Blxml.xmlfile%2Bfor%2Bthe%2Bstandard%2Blibrary%2Clicense_MIT%2BLicense%2Cp_Ii9wYWNrYWdlcy9ldC14bWxmaWxlIg%2Cs_FHBzfYbWA3692JVk.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "et-xmlfile 2.0.0"
  "twitter:image": "https://pypx.app/_og/d/h_630%2Cc_PackageCard%2Cname_et-xmlfile%2Cversion_2.0.0%2Csummary_An%2Bimplementation%2Bof%2Blxml.xmlfile%2Bfor%2Bthe%2Bstandard%2Blibrary%2Clicense_MIT%2BLicense%2Cp_Ii9wYWNrYWdlcy9ldC14bWxmaWxlIg%2Cs_FHBzfYbWA3692JVk.png"
---

> Index of every page on this site: [llms.txt](https://pypx.app/llms.txt)

# **et-xmlfile**

v2.0.0

An implementation of lxml.xmlfile for the standard library

18 KB Python 3.8+ py3-none-anyMIT License Possibly Unmaintained

[**Diff **](https://pypx.app/packages/et-xmlfile/diff)

`$ uv add et-xmlfile`

![coverage status](https://foss.heptapod.net/openpyxl/et_xmlfile/badges/branch/default/coverage.svg)

# 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](http://lxml.de/api.html#incremental-xml-generation) 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](http://pyddf.de) 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.

## **Details **

<dl>

<dt>Version</dt>
<dd>2.0.0</dd>

<dt>License</dt>
<dd>MIT License</dd>

<dt>Python</dt>
<dd>&gt;=3.8</dd>

<dt>Maintainer</dt>
<dd>See AUTHORS.txt</dd></dl>

## **Links**

- [Documentation](https://openpyxl.pages.heptapod.net/et_xmlfile/)
- [Homepage](https://foss.heptapod.net/openpyxl/et_xmlfile)
- [Source](https://foss.heptapod.net/openpyxl/et_xmlfile)
- [Tracker](https://foss.heptapod.net/openpyxl/et_xmfile/-/issues)
- [View on PyPI](https://pypi.org/project/et-xmlfile/)

## **Maintainers **

- See AUTHORS.txt · [charlie.clark@clark-consulting.eu](mailto:charlie.clark@clark-consulting.eu)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://pypx.app/#website","@type":"WebSite","description":"The Python Package Index, reimagined. Fast search, dependency insights, download trends, and changelogs — all in one place.","name":"pypx","url":"https://pypx.app/"},{"@id":"https://pypx.app/packages/et-xmlfile#webpage","@type":"WebPage","description":"An implementation of lxml.xmlfile for the standard library","name":"et-xmlfile","url":"https://pypx.app/packages/et-xmlfile","isPartOf":{"@id":"https://pypx.app/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://pypx.app/packages/et-xmlfile"]}]},{"@id":"https://pypx.app/packages/et-xmlfile#/schema/software-application/1","@type":"SoftwareApplication","applicationCategory":"DeveloperApplication","description":"An implementation of lxml.xmlfile for the standard library","license":"MIT License","name":"et-xmlfile","softwareVersion":"2.0.0"}]}
```

## Sitemap

See the full [sitemap](https://pypx.app/sitemap.md) for all pages.
