Pythie
CategoriesTrending
An open index of Python tools.Pythie’s IndexLegal noticePrivacyData: PyPI (package metadata; download statistics under CC BY 4.0, via ClickHouse), deps.dev (CC BY 4.0), GitHub, OSV.

lxml

6.2.0ActivePythie’s Index: 84

Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API.

Actively maintained. Last release 2 days ago, commits in 18 of the last 26 weeks. A safe choice.

File Formats & ParsingWeb Scraping & Automation
$pip install lxml
lxml/lxmlHomepagePyPI
lxml is a Pythonic, mature binding for the libxml2 and libxslt libraries. It provides safe and convenient access to these libraries using the ElementTree API. It extends the ElementTree API significantly to offer support for XPath, RelaxNG, XML Schema, XSLT, C14N and much more. To contact the project, go to the `project home page <https://lxml.de/>`_ or see our bug tracker at https://launchpad.net/lxml In case you want to use the current in-development version of lxml, you can get it from the github repository at https://github.com/lxml/lxml . Note that this requires Cython to build the sources, see the build instructions on the project home page. After an official release of a new stable series, bug fixes may become available at https://github.com/lxml/lxml/tree/lxml-6.2 . Running ``pip install https://github.com/lxml/lxml/archive/refs/heads/lxml-6.2.tar.gz`` will install the unreleased branch state as soon as a maintenance branch has been established. Note that this requires Cython to be installed at an appropriate version for the build. 6.2.0 (2026-11-27) ================== This release contains several security fixes. Upgrading is recommended. Bugs fixed ---------- * GHSA-23p9-v872-36p9: Passing ``CDATA()`` wrapped content ending with a bare ``]`` character into an ``xmlfile`` reads arbitrary data from the Python heap and includes it in the generated XML document. This allows reading random content from the application memory and/or crashing the application. Issue found by shaggitza. * GHSA-59qx-3jjv-x996: Parsing a document defining a non-wellformed entity with the default configuration of ``iterparse()`` could crash the application. This issue is network exploitable if the application parses untrusted documents from remote sites. Issue found by Claude and Ada Logics. * GHSA-27mw-m39x-fm32: Comments and PIs from the internal/external DTD subsets were reported through the SAX/target-parser and iterparse/pull parser interfaces which could lead to internal memory corruption and crashes. They are no longer reported. Issue found by Claude and Ada Logics. * GH#550: The output of ``htmldiff()`` could contain unescaped links, allowing for content injection. Patch by Nayana-Naik73. * LP#2011542: A processing instruction after the root element crashed ``lxml.sax.ElementTreeContentHandler`` with ``IndexError``. It is now kept as following sibling. Patch by cherith. * LP#2175761: Resolvers that returned a string with a ``base_url`` leaked a copy of the URL with libxml2 2.14 and later. Patch by Pierre-Yves Le Borgne. * GH#546: ``lxml.html.diff`` is a bit more stable on PyPy. Patch by Matti Picus. * The souppoarser did not immediately close the file after parsing if it opened it. * The parallel ``make`` execution during library build could fail when it tries to request more CPUs than available. * LP#2175761: The C code that Cython generates for ``lxml.etree`` no longer depends on ``PYTHONHASHSEED``. The exact C types that Cython inferred for some untyped variables was not deterministic. It is now statically declared. Patch by Pierre-Yves Le Borgne. Other changes ------------- * The binary wheels include several security relevant bug fixes for libxml2 on all platforms. https://github.com/lxml/lxml/blob/lxml-6.2.0/libxml2-2.14.6-backport1.patch https://github.com/lxml/lxml/blob/lxml-6.2.0/libxslt-1.1.43-backport1.patch https://github.com/lxml/libxml2-win-binaries/releases/tag/2026.11.23 * Built with Cython 3.3.2. Wheels for Python 3.8/3.9 use Cython 3.2.9.

Popularity

Downloads / month
445.4M
GitHub stars
3.1K
Downloads, last 7 days
93.8M-6%
Stars, last 7 days
–
Direct dependents
9.4K
All dependents
28.9K

Pythie’s Index

How it works
84

Healthy

Maintenance, out of 100

  • Recent release

    last release 1 days ago

  • Commit activity

    18/26 weeks with commits

  • Release cadence

    11 releases in 12 months

  • Issues & PRs handled

    no data

  • Contributor spread

    9 authors in last 100 commits

  • OpenSSF Scorecard

    5.6/10

Commits, last 26 weeks301

Releases

Latest
6.2.0
Released
Nov 27, 2026
Releases, 12 months
11
First release
Jul 3, 2007

Compatibility

Requires Python
>=3.8
Tested on
3.8 · 3.9 · 3.10 · 3.11 · 3.12 · 3.13 · 3.14 · 3.15
License
BSD-3-Clause (Permissive)

Alternatives

Use instead of lxml: tools that do the same job, closest first.

Compare with xmlschema →Compare with beautifulsoup4 →Compare with leptris →Compare all 4 →

  • xmlschema4.3.2ActivePythie’s Index: 43

    An XML Schema validator and decoder

    Validation & SerializationFile Formats & Parsing4757.9M/moReleased Jun 30, 2026
  • beautifulsoup44.15.0ActivePythie’s Index: 67

    Screen-scraping library

    Web Scraping & AutomationFile Formats & Parsing–324.6M/moReleased Jun 7, 2026
  • leptris1.9.452.0ActivePythie’s Index: 83

    Python bindings for libleptris — fast XML 1.0 parsing and XPath 1.0, shaped like lxml

    File Formats & Parsing0250.3K/moReleased Nov 28, 2026
  • selectolax1.0.2ActivePythie’s Index: 82

    A fast HTML5 parser with CSS selectors, written in Cython, using the Lexbor engine.

    Web Scraping & AutomationHTTP & Networking1.7K6.7M/moReleased Oct 22, 2026
  • markupever0.5.1ActivePythie’s Index: 77

    The fast, most optimal, and correct HTML & XML parsing library.

    File Formats & ParsingWeb Scraping & Automation4191.6K/moReleased Nov 16, 2026
  • BeautifulSoup3.2.2InactivePythie’s Index: 19

    Screen-scraping library

    Web Scraping & AutomationFile Formats & Parsing–153K/moReleased Oct 5, 2019

Works well with

Use together with lxml: extensions, drivers, servers and companion tools.

  • defusedxmlPythie’s Index: 18XML bomb protection for Python stdlib modules291.5M downloads/mo
  • cssselectPythie’s Index: 85cssselect parses CSS3 Selectors and translates them to XPath 1.023.6M downloads/mo
  • parselPythie’s Index: 87Parsel is a library to extract data from HTML and XML using XPath and CSS selectors3.4M downloads/mo
  • pyqueryPythie’s Index: 45A jquery-like library for python1.4M downloads/mo
  • xsdataPythie’s Index: 72Python XML Binding3.4M downloads/mo
  • pydantic-xmlPythie’s Index: 61pydantic xml extension3M downloads/mo