inscriptis
inscriptis - HTML to text converter.
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 inscriptisuv
uv add inscriptispoetry
poetry add inscriptisInstalling 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
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
BeautifulSoupBeautiful Soup parses HTML and XML documents…
permissive · top 15,000 on PyPI
jusTextjusText removes boilerplate content…
permissive · top 5,000 on PyPI
parselParsel extracts data from HTML, JSON, and XML…
permissive · top 5,000 on PyPI
strip-markdownConverts markdown text to plain text, removing…
permissive · top 15,000 on PyPI
textractExtracts text from documents in multiple…
permissive · top 15,000 on PyPI
rst2ansiConverts reStructuredText documents to…
permissive · top 15,000 on PyPI
beautifulsoup4Beautiful Soup parses HTML and XML documents…
permissive · top 100 on PyPI
jira2markdownConverts JIRA markup text to Markdown…
permissive · top 15,000 on PyPI
css-inlineInlines CSS from style and link tags directly…
permissive · top 5,000 on PyPI
itemloadersItemloaders extracts and standardizes…
permissive · top 5,000 on PyPI