skillfed

inscriptis

inscriptis - HTML to text converter.

inscriptis v2.7.4 1.3M downloads/30d#4,023 on PyPI345
Permissive license Apache-2.0 Active released

What it is and what it does

Inscriptis is a Python library that converts HTML to plain text with awareness of document layout and structure. Unlike simple text extraction tools, it interprets HTML semantics (lists, tables, alignment) and a subset of CSS properties to produce text output that more closely resembles how a browser would render the page. This makes it particularly useful when the spatial arrangement of text matters—for knowledge extraction, NLP tasks, or data science work on web content.

The library provides three interfaces: a Python API for embedding in applications, a command-line tool for batch conversion of files or URLs, and support for annotated output where text can be tagged with semantic information from the original HTML structure. It handles complex constructs like nested tables and supports multiple output formats including XML and JSONL for compatibility with annotation tools.

Use it for:

  • Extract clean text from web pages for machine learning datasets or language model training while preserving document structure.
  • Convert HTML email or web content to readable plain text for archival, search indexing, or accessibility purposes.
  • Annotate extracted text with semantic labels derived from HTML tags and attributes for knowledge extraction or document classification tasks.
  • Batch convert HTML files to text with layout-aware formatting for content migration or data pipeline preprocessing.
  • Support qualitative analysis workflows by generating structured text output suitable for manual annotation in tools like doccano.

Worth the install?

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

Converts HTML documents to plain text while preserving layout, supporting nested tables, CSS subset interpretation, and optional text annotation based on HTML structure.

Yes. Inscriptis is actively maintained, has no known vulnerabilities, installs with low friction, and solves a real problem—layout-aware HTML-to-text conversion—better than generic alternatives. Its Apache-2.0 license is permissive. Install it if you need text extraction from HTML where structure and layout matter; skip it if you only need basic text stripping.

Install

inscriptis on PyPI

pip

pip install inscriptis

uv

uv add inscriptis

poetry

poetry add inscriptis

Installing inscriptis

Before you install

Low friction: pure Python wheel with only two runtime dependencies (lxml, requests). Actively maintained with a release 4 days ago; repo shows 345 stars and continuous development.

License in practice

Apache-2.0 permissive license allows use in commercial and proprietary projects with minimal restrictions; attribution required but no copyleft obligations.

Quickstart

pip install inscriptis

import urllib.request
from inscriptis import get_text

html = urllib.request.urlopen('https://example.com').read().decode('utf-8')
text = get_text(html)
print(text)

Requires Python 3.10 or later.

Verify before relying

  • Performance characteristics on very large HTML documents or batch processing scenarios.
  • Actual CSS subset coverage and which specific properties are interpreted beyond those listed in the description.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 2 — lxml, requests
Maintenance actively maintained — 4 days since the last release
Last repo commit
First released
Downloads 1,345,082/month — #4,023 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: inscriptis-2.7.4-py3-none-any.whl

Keywords: HTML, converter, text

Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Text ProcessingTopic :: Text Processing :: Markup :: HTMLTopic :: Utilities

Tags

html to text conversionextract text from htmllayout-aware html parsinghtml text extractionannotated html to textnested table conversionweb scraping text extraction
text-extractionweb-scrapingnlp-preprocessing

More Utilities packages