unstructured
A library that prepares raw documents for downstream ML tasks.
What it is and what it does
Unstructured is a document processing library that converts raw files in many formats into structured, machine-readable elements. It handles PDFs, Word documents, HTML, emails, images, and dozens of other formats, extracting text and metadata while preserving document structure. The library is designed to prepare unstructured data for downstream machine learning tasks, particularly for large language models.
The package works by partitioning documents into semantic elements (paragraphs, tables, headers, etc.), then optionally enriching and chunking them for vector databases or other ML workflows. It ships with 24 runtime dependencies including parsing libraries (beautifulsoup4, lxml, html5lib), NLP tools (spacy, langdetect), and numerical computing (numpy, numba). Installation requires system-level dependencies for full format support, though a minimal install handles text and markup formats without them.
Use it for:
- Extract and structure text from PDFs and scanned documents for ingestion into vector databases or RAG systems
- Parse email messages and attachments to prepare them for LLM analysis or archival processing
- Convert Word documents, PowerPoint slides, and other office formats into structured text for batch processing
- Chunk long documents into semantically meaningful segments for embedding and retrieval workflows
- Detect and extract tables from PDFs and images for structured data extraction pipelines
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Ingests and pre-processes unstructured documents (PDFs, HTML, Word, emails, images) into structured elements for machine learning pipelines, supporting 60+ file types with parsing, chunking, and enrichment.
Yes, with conditions. Install if you need to process multiple document formats and can manage the 24 runtime dependencies and system-level tools. The active maintenance, permissive license, and broad format support make it a solid choice for LLM data preparation pipelines. Skip if you only need to parse a single format (use a lighter, format-specific library instead) or if your environment cannot accommodate the dependency footprint.
Install
unstructured on PyPI
pip
pip install unstructureduv
uv add unstructuredpoetry
poetry add unstructuredInstalling unstructured
Before you install
Low friction installation with a pure Python wheel. Active maintenance with a release 11 days ago and 15312 GitHub stars. Requires 24 runtime dependencies including heavy libraries (spacy, numba, numpy, lxml), so initial install may take time despite the wheel format.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most production and proprietary projects.
Quickstart
pip install unstructured
from unstructured.partition.auto import partition
elements = partition(filename="document.pdf")
for el in elements:
print(el)
System dependencies required for full functionality: libmagic-dev (filetype detection), poppler-utils (PDFs/images), tesseract-ocr (OCR), libreoffice (MS Office). Minimal install works for text, HTML, XML, JSON, emails only.
Verify before relying
- Whether all 60+ file types mentioned in the description are fully supported in version 0.25.2 or if some require paid/enterprise features
- Performance characteristics and memory footprint when processing large documents or batches
- Whether the MCP server integration mentioned in the description is included in the PyPI package or requires separate installation
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<3.14,>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 24 — beautifulsoup4, charset-normalizer, emoji, filelock, filetype, html5lib, installer, langdetect, lxml, nh3, numba, numpy, psutil, python-iso639, python-magic, python-oxmsg, rapidfuzz, regex, requests, spacy, tqdm, typing-extensions, unstructured-client, wrapt |
| Maintenance | actively maintained — 11 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,518,206/month — #2,084 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: unstructured-0.25.2-py3-none-any.whl
Keywords: CV, HTML, NLP, PDF, XML, parsing, preprocessing
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
unstructured-clientHTTP client SDK for the Unstructured Platform…
permissive · top 5,000 on PyPI
unstructured-inferenceRuns inference on layout-parsing and…
permissive · top 5,000 on PyPI
unstructured-ingestUnstructured Ingest is a local ETL pipeline…
permissive · top 15,000 on PyPI
langchain-unstructuredIntegrates LangChain with Unstructured to…
permissive · top 15,000 on PyPI
pymupdf4llmConverts PDFs and documents into clean,…
agpl · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
chonkieChonkie splits text into semantically…
permissive · top 5,000 on PyPI
kreuzbergExtracts text, tables, images, and metadata…
permissive · top 15,000 on PyPI
pdftextExtracts plain text or structured blocks,…
permissive · top 15,000 on PyPI
mineruConverts PDF, DOCX, PPTX, XLSX, images, and web…
unclear · top 15,000 on PyPI