# lxml/lxml

The lxml XML toolkit for Python

Repository: https://github.com/lxml/lxml
Canonical: https://ross.abutalabs.com/products/lxml
Homepage: https://lxml.de/
Language: Python
License: BSD-3-Clause
License Family: permissive
Last push: 2026-08-25T14:33:58+00:00

## Health v2 (maintenance only)
Score: 99/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 99, longevity 100
- inputs: {"age_days": 5682, "days_push": 8, "days_rel": 11, "gap_med": 23.5, "n_releases_24m": 15}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3050, forks 634 (observed 2026-08-28T04:07:39.615330+00:00)

## What it is
lxml is a fast, feature-rich Python library for processing XML and HTML, built on the C libraries libxml2 and libxslt. It provides an ElementTree-compatible API plus XPath, XSLT, schema validation (DTD, RelaxNG, XMLSchema, Schematron), CSS selectors, and HTML parsing utilities.

## Use cases
- parse xml files in python
- scrape html pages with xpath
- validate xml against an xsd schema
- transform xml with xslt
- extract data from html using css selectors
- generate xml documents programmatically
- parse malformed html with a lenient parser

## When to choose
- you need fast, memory-efficient XML/HTML parsing in Python
- you need XPath, XSLT, or schema validation support
- you want an ElementTree-compatible API with more features
- you are scraping or cleaning real-world HTML

## When to avoid
- you only need simple XML parsing and want zero C dependencies (use stdlib ElementTree)
- you are parsing JSON or non-markup data formats
- you need a pure-Python solution for restricted environments

## Facets
- artifact type: library
- maturity: stable
- function: parser, serialization, web-scraping, developer-tools
- domain: parsers, web-development, developer-tools, files
- platform: python, cross-platform
- tags: xml, html, xpath, xslt, libxml2, cssselect, schema-validation

## Member repositories
- lxml/lxml (main) score 99

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:39.615330+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:28:54.859368+00:00, confidence not recorded.
  - readme: https://github.com/lxml/lxml (fetched 2026-08-28T04:07:39.615330+00:00, sha 890c9368cb99)
  - homepage: https://lxml.de/ (fetched 2026-08-29T09:44:13.832468+00:00, sha db2a97d70e44)
  - site_page: https://lxml.de/installation.html (fetched 2026-08-29T09:44:13.837417+00:00, sha 8767112a6f00)
  - site_page: https://lxml.de/FAQ.html (fetched 2026-08-29T09:44:13.839449+00:00, sha 2401592eb09d)
  - site_page: https://lxml.de/index.html (fetched 2026-08-29T09:44:13.835341+00:00, sha db2a97d70e44)
  - site_page: https://lxml.de/changes-7.0.0a3.html (fetched 2026-08-29T09:44:13.842851+00:00, sha 271928c8c700)
  - site_page: https://lxml.de/api/index.html (fetched 2026-08-29T09:44:13.848055+00:00, sha 2fc72892857e)
  - site_page: https://lxml.de/6.0 (fetched 2026-08-29T09:44:13.849771+00:00, sha f8c71e6c72b3)
- Data as of 2026-08-30T08:39:29.467469+00:00.
