textract
extract text from any document. no muss. no fuss.
What it is and what it does
textract is a document text extraction library that abstracts away the complexity of handling multiple file formats. Instead of learning separate APIs for PDF, Word, PowerPoint, Excel, and image files, you call a single function and get text back. It wraps specialized libraries (pdfminer-six for PDFs, python-pptx for presentations, xlrd for spreadsheets, docx2txt for Word, pillow for images, and others) into one consistent interface.
The package is designed for straightforward use: point it at a file, get text out. It handles format detection and delegates to the appropriate underlying tool. With 4690 GitHub stars and active maintenance, it serves as a practical utility for workflows that need to ingest text from mixed document sources without writing format-specific extraction code.
Use it for:
- Batch processing a folder of mixed document types (PDFs, Word docs, spreadsheets) to extract and index text.
- Building a document search or archival system that needs to read text from files in multiple formats.
- Automating data extraction from email attachments and embedded documents.
- Preparing documents for NLP pipelines by converting various formats to plain text.
- Creating a document ingestion layer for a content management or knowledge base system.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Extracts text from documents in multiple formats (PDF, Word, PowerPoint, Excel, images, email) with a single unified interface.
Yes, if you need to extract text from multiple document formats and want to avoid learning separate APIs for each. The low install friction, active maintenance, MIT license, and unified interface make it a practical choice for document processing workflows. No known vulnerabilities as of 2026-08-14.
Install
textract on PyPI
pip
pip install textractuv
uv add textractpoetry
poetry add textractInstalling textract
Before you install
Low friction install with 11 runtime dependencies. Active maintenance: last commit 2026-08-05, release 109 days ago. Supports current Python versions (requires >=3.9).
License in practice
MIT license permits commercial and private use with minimal restrictions; you must include a copy of the license and copyright notice.
Quickstart
pip install textract
import textract
text = textract.process('document.pdf')
print(text)
Requires system libraries for some formats (e.g., pdfminer-six for PDF, python-pptx for PowerPoint); pillow for image text extraction.
Verify before relying
- Whether OCR capabilities are included for scanned images or if text extraction is limited to searchable documents.
- Performance characteristics with large documents or batch processing of many files.
- Specific format support and any known limitations or edge cases per document type.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 11 — pillow, speechrecognition, argcomplete, beautifulsoup4, lxml, chardet, docx2txt, extract-msg, pdfminer-six, python-pptx, xlrd |
| Maintenance | actively maintained — 109 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 454,872/month — #6,565 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: textract-2.0.0-py3-none-any.whl
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
amazon-textract-textractorTextractor wraps Amazon Textract APIs to…
permissive · top 5,000 on PyPI
pdftotextExtracts text from PDF files, including…
permissive · top 15,000 on PyPI
amazon-textract-response-parserParses JSON responses from Amazon Textract OCR…
permissive · top 5,000 on PyPI
amazon-textract-callerWrapper around Amazon Textract that handles…
permissive · top 5,000 on PyPI
docling-parseExtracts text, coordinates, and bitmap images…
permissive · top 5,000 on PyPI
pdfminerExtracts text and layout information from PDF…
permissive · top 15,000 on PyPI
docx2txtExtracts text, headers, footers, hyperlinks,…
unclear · top 5,000 on PyPI
inscriptisConverts HTML documents to plain text while…
permissive · top 5,000 on PyPI
kreuzbergExtracts text, tables, images, and metadata…
permissive · top 15,000 on PyPI
flashtextExtracts or replaces keywords in text using the…
permissive · top 5,000 on PyPI