textract pulls plain text from varied file formats through one Python API or CLI. It wraps format-specific extractors so you avoid separate tools per document type.
Overview
textract targets “dark data” locked in office documents, PDFs, presentations, images, and archives where you need clean text for search or NLP. Call textract.process on a path in Python or run the textract command on a file extension from the shell.
Supported types listed in project documentation include CSV, TSV, DOC and DOCX, EML, EPUB, GIF and JPEG and PNG and TIFF via OCR, JSON, HTML, MP3 and OGG and WAV audio, MSG, ODT, PDF via pdftotext or pdfminer.six, PPTX, PS, RTF, TXT, XLS and XLSX, and related dependencies documented per format on Ubuntu, macOS, Windows, and FreeBSD.
The design stays method-agnostic: each format uses an appropriate backend rather than forcing one parser for everything. Documentation compares the approach to Apache Tika and a Node package of the same name, emphasizing a single Python interface and optional command-line use alongside library imports.
Installation notes describe operating-system packages needed for OCR, audio, and legacy Office helpers, plus continuous integration references for required system libraries.
Key features
- Unified process() Python API
- Command-line textract interface
- PDF via pdftotext or pdfminer
- Office formats via dedicated backends
- Image OCR through tesseract
- Audio transcription helpers
- HTML parsing via BeautifulSoup
- Spreadsheet support via xlrd
Use cases
- Extract text from PDFs in pipelines
- Normalize uploads before indexing
- Mine slides and Word docs for NLP
- OCR scanned images to plain text
- Shell one-liners for quick extraction