skillfed

readability-lxml

fast html to text parser (article readability tool) with python 3 support

readability-lxml v0.8.4.1 2.1M downloads/30d#3,334 on PyPI2,895
Permissive license Apache License 2.0 AGING released

What it is and what it does

readability-lxml is a Python port of arc90's Readability algorithm that parses HTML documents and isolates the main article content—title, body text, and optionally images—stripping away navigation, ads, and boilerplate. It uses lxml for DOM manipulation and cssselect for content scoring, applying heuristics to identify the primary reading material.

The package is designed for content extraction pipelines where you need clean article text from HTML. It supports CJK text, can preserve multiple images per article, and outputs HTML5-formatted summaries. With 2058771 monthly downloads, it serves as a standard tool for news aggregators, content analysis systems, and archival tools.

Use it for:

  • Extract article text from HTML documents for content aggregation or archival without manual parsing
  • Build a content pipeline that isolates main text from pages with heavy sidebar and footer markup
  • Prepare training data for NLP models by cleaning HTML-sourced documents to pure article text
  • Implement a reader mode or reading list feature that strips formatting and focuses on text
  • Analyze article metadata (title, author, images) from bulk HTML content

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Extracts and cleans the main article text and title from HTML documents using lxml-based parsing and heuristic content detection.

Yes, if you need reliable article extraction from HTML documents. The low install friction, permissive license, and broad Python version support (3.8–3.13) make it practical. The aging maintenance status (468 days since last release) is a minor concern for a stable, mature tool, but verify that recent HTML patterns in your target documents still parse correctly before committing to production use.

Install

readability-lxml on PyPI

pip

pip install readability-lxml

uv

uv add readability-lxml

poetry

poetry add readability-lxml

Installing readability-lxml

Before you install

Low friction: pure Python wheel with four straightforward runtime dependencies (chardet, lxml, cssselect, lxml-html-clean). Maintenance status is aging—last release was 468 days ago—but the repository remains active and the package has accumulated 2895 stars.

License in practice

Apache License 2.0 is permissive, allowing commercial and private use with minimal restrictions; you must retain license and copyright notices but face no copyleft obligations.

Quickstart

pip install readability-lxml

from readability import Document

doc = Document(html_content)
print(doc.title())
print(doc.summary())

Verify before relying

  • Current performance characteristics on large documents or high-volume extraction workloads
  • Compatibility with modern HTML5 edge cases beyond the changelog's mention of improved HTML5 tag handling
  • Whether the package requires external HTTP fetching or works only with pre-downloaded HTML content

Package facts

License Apache License 2.0 (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 4 — chardet, lxml, cssselect, lxml-html-clean
Maintenance aging — 468 days since the last release
Last repo commit
First released
Downloads 2,058,771/month — #3,334 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: readability_lxml-0.8.4.1-py3-none-any.whl

Environment :: Web EnvironmentIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: PyPyTopic :: InternetTopic :: Software Development :: Libraries :: Python ModulesTopic :: Text Processing :: IndexingTopic :: Utilities

Tags

html article extractionreadability parser pythonextract main content from htmlhtml to text articlecontent extraction toolweb scraping readabilityclean html body text
web-scrapingcontent-extractionhtml-parsing

More Python Modules packages