LiteParse extracts text from PDFs, office documents, and images using LiteParse from LlamaIndex. It runs entirely locally with no cloud API dependencies.
Installation
LiteParse runs locally. OCR uses bundled Tesseract by default. Office document conversion requires LibreOffice, and image conversion requires ImageMagick.
Initialization
Parameters
Whether to enable OCR for scanned/image text (defaults to LiteParse’s behavior when
None).Methods
process()
Process a file and return aDocument.
Parameters
Returns
Document containing the extracted text content.
process_batch()
Process multiple files at once.Parameters
Returns
list[Document] where each document contains extracted text from a file.
parse()
Parse raw text into aDocument (wraps text as-is, since LiteParse operates on files).
Parameters
Returns
Document containing the provided text.
Supported File Types
Usage
Standalone
Pipeline
Use.process_with("liteparse") to add local document parsing to a pipeline:
Local RAG Pipeline
Build a complete pipeline from documents to vector database without any cloud OCR:Targeted Page Extraction
Parse only specific pages from a large PDF:Integration with Chunkers
LiteParse returns aDocument, making it compatible with any chunker:
Notes
- Runs entirely locally with no API keys or cloud dependencies
- OCR quality depends on image resolution and the Tesseract language pack
- Office documents (Word, PowerPoint, Excel) require LibreOffice to be installed
- Image files require ImageMagick to be installed
- Use
num_workersto control parallelism for multi-page OCR - Use
target_pagesfor efficient extraction from large PDFs - API calls are synchronous by default; use
aprocess()for async execution
