python-readability: Extract Clean Main Content from HTML Documents
This repository profile is provided by osrepos.com, an open source repository discovery platform.

Summary
python-readability is a fast Python port of arc90's Readability tool, designed to extract and clean the main body text and title from any given HTML document. It provides an efficient way to process web content, making it easier to focus on essential information. This library is regularly updated to match the latest readability.js functionalities, ensuring modern compatibility and performance.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
python-readability is a powerful and fast Python library that allows developers to extract the main body text and title from any HTML document. It is a robust port of arc90's original Readability project, continuously updated to align with the latest readability.js features. This tool is invaluable for tasks requiring clean, focused content extraction from web pages, such as building RSS feeds, content aggregators, or text analysis tools.
Installation
Installation is straightforward using pip or conda.
$ pip install readability-lxml
Alternatively, with conda:
$ conda install -c conda-forge readability-lxml
Examples
Using python-readability is simple. Here's a quick example demonstrating how to fetch a web page and extract its title and summary:
import requests
from readability import Document
response = requests.get('http://example.com')
doc = Document(response.content)
print(doc.title())
# Output: 'Example Domain'
print(doc.summary())
# Output: "<html><body><div><body id=\"readabilityBody\">\n<div>\n <h1>Example Domain</h1>\n\n<p>This domain is established to be used for illustrative examples in documents. You may\nuse this\n domain in examples without prior coordination or asking for permission.</p>\n\n <p><a href=\"http://www.iana.org/domains/example\">More information...</a></p>\n</div>\n\n</body>\n</div></body></html>"
Why use it
python-readability stands out for several reasons:
- Speed and Efficiency: It's a fast implementation, crucial for processing large volumes of data.
- Modern Compatibility: Regularly updated to match
readability.js, ensuring it works well with contemporary web content. - Comprehensive Extraction: Beyond just text, it can extract titles, handle images (including saving all images with
keep_all_images=True), and supports CJK characters. - Python 3.x Support: Fully compatible with a wide range of Python 3 versions (3.8 - 3.13).
- Clean Output: Replaces XHTML output with HTML5 in
summary()calls, providing modern and cleaner HTML. - Active Development: The change log indicates continuous improvements and bug fixes, reflecting an actively maintained project.
Links
- GitHub Repository: https://github.com/buriy/python-readability
- PyPI Package: https://pypi.python.org/pypi/readability-lxml
Related repositories
Similar repositories that may be relevant next.

requests-html: Pythonic HTML Parsing with JavaScript Support
July 25, 2026
requests-html is a Python library designed to simplify HTML parsing and web scraping. It extends the familiar Requests experience with powerful parsing capabilities, including full JavaScript support via Chromium, CSS selectors, and XPath. This makes it an ideal tool for developers needing to interact with dynamic web content.

Grab: A Powerful Python Web Scraping Framework
July 24, 2026
Grab is a robust Python web scraping framework designed to simplify complex data extraction tasks. It provides comprehensive tools for handling network requests, processing scraped content, and managing asynchronous operations through its powerful Spider component. Developers can leverage features like automatic cookie support, HTTP/SOCKS proxies, and XPath queries for efficient web data collection.

Awesome Django: A Curated List of Essential Django Resources and Packages
July 24, 2026
Awesome Django is a comprehensive curated list of outstanding Django apps, projects, and resources. It focuses on mature, well-maintained packages with good documentation and active user bases. This repository serves as an invaluable guide for developers looking for high-quality tools and examples within the Django ecosystem.

Awesome Django: A Curated List of Essential Resources for Developers
July 24, 2026
Awesome Django is a comprehensive, curated list of exceptional resources, packages, and tools for Django web development. It serves as an invaluable guide for developers looking to enhance their projects with the best the Django ecosystem has to offer. With over 11,000 stars, it's a trusted community-maintained collection.
Source repository
Open the original repository on GitHub.
9 counted GitHub visits