Skip to main content
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

Optional[bool]
default:"None"
Whether to enable OCR for scanned/image text (defaults to LiteParse’s behavior when None).
Optional[str]
default:"None"
Language code for OCR (e.g., "eng", "fra", "deu").
Optional[str]
default:"None"
Optional HTTP OCR server URL (e.g., EasyOCR or PaddleOCR server).
Optional[int]
default:"None"
Maximum number of pages to parse.
Optional[str]
default:"None"
Specific pages to parse (e.g., "1-5,10").
Optional[float]
default:"None"
Rendering resolution for PDF pages.
Optional[int]
default:"None"
Number of pages to OCR in parallel (defaults to CPU cores - 1).
Optional[str]
default:"None"
Password for protected PDFs.

Methods

process()

Process a file and return a Document.

Parameters

Union[str, Path]
required
Path to the file to process.

Returns

Document containing the extracted text content.

process_batch()

Process multiple files at once.

Parameters

list[Union[str, Path]]
required
List of file paths to process.

Returns

list[Document] where each document contains extracted text from a file.

parse()

Parse raw text into a Document (wraps text as-is, since LiteParse operates on files).

Parameters

str
required
Raw text to wrap into a Document.

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 a Document, 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_workers to control parallelism for multi-page OCR
  • Use target_pages for efficient extraction from large PDFs
  • API calls are synchronous by default; use aprocess() for async execution