# lxml

> XML and HTML processing for Python

Source: https://talira.ai/catalog/lxml-7n17zqad
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / parsing / xml html](https://talira.ai/categories/developer-tools/parsing/xml-html), [languages / python](https://talira.ai/categories/languages/python)
- Licence: BSD-3-Clause[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [lxml dev team](https://talira.ai/orgs/lxml-dev-team.md)

lxml is a Python binding for the C libraries libxml2 and libxslt, combining their speed and XML feature coverage with a Pythonic API that is mostly compatible with ElementTree. It parses and serialises XML and HTML, including incremental and event-based parsing, supports XPath and XSLT with Python extension functions, validates against DTD, RelaxNG, XML Schema and Schematron, and adds lxml.objectify for working with XML as Python objects and lxml.html for HTML parsing, link handling, forms, diffs and CSS selectors.

## Links

- Website: https://lxml.de/
- GitHub: https://github.com/lxml/lxml
- Docs: https://lxml.de/tutorial.html

## Problems it solves

- parse a large XML file in Python quickly and query it with XPath
- validate XML documents against an XML Schema from Python
- run an XSLT stylesheet on XML from a Python script
- pull data out of messy HTML pages in Python

## Features

- ElementTree-compatible API
- XPath and XSLT, with Python extension functions
- validation with DTD, RelaxNG, XML Schema and Schematron
- lxml.html for HTML parsing, links, forms and diffs
- CSS selectors via lxml.cssselect
- incremental and event-based parsing with iterparse

## Trust

Overall: 0.66 out of 1.
Signals: maintenance 1.00, adoption 0.70, momentum 0.37, community 0.91, backing 0.30, extensibility 0.00.

- last commit 2 days ago
- 162 commits in the last 90 days
- latest release lxml-6.2.0 2 days ago
- 3.1k GitHub stars
- 190 contributors
- accepts sponsorship (Github, Tidelift)
- backed by lxml dev team

## Alternatives

- [xmltodict](https://talira.ai/catalog/xmltodict-573f02aj.md): Work with XML in Python as if it were JSON: parse it into dicts and back
- [Beautiful Soup](https://talira.ai/catalog/beautiful-soup-2tvwrsby.md): Python library for pulling data out of HTML and XML

## Sources

[^1]: https://github.com/lxml/lxml/blob/master/LICENSE.txt (checked 27 Nov 2026)
