#201·zerox

[Python SDK] Feature Parity Gap: `errorMode`, `correctOrientation`, `trimEdges`, `schema`, and `extractPerPage` Missing vs Node.js SDK

Author: Akhilesh29Created Mar 22, 2026Updated May 27, 2026

Overview

The Python (py-zerox) SDK is missing several features that are available in the Node.js SDK. This creates a significant parity gap for Python users. The README's own comparison table already acknowledges these gaps, but there is no tracking issue for resolving them.


Missing Features

1. error_mode — Configurable Error Handling

Node.js supports ErrorMode.THROW and ErrorMode.IGNORE.
In Python, there is no equivalent — failed pages have no configurable behavior.

Expected Python API:

python
result = await zerox(
    file_path="file.pdf",
    model="gpt-4o-mini",
    error_mode="ignore"  # or "throw"
)

2. correct_orientation — Auto-Orientation Fix

Node.js uses Tesseract-based OSD to detect and correct rotated pages before sending to the vision model. Python has no such step, leading to degraded OCR quality on scanned/rotated documents.


3. trim_edges — Background Edge Trimming

Node.js trims edge pixels that match the background color (top-left pixel default), improving model focus on actual content. No equivalent exists in Python.


4. schema + extract_per_page — Structured Data Extraction

This is the most impactful missing feature. Node.js supports JSON Schema-based extraction:

javascript
const result = await zerox({
  filePath: "invoice.pdf",
  extractOnly: true,
  schema: {
    type: "object",
    properties: {
      invoice_number: { type: "string" },
      total_amount: { type: "number" }
    }
  }
});

Python users have no native way to do structured extraction — they must manually post-process raw markdown output.


Feature Parity Table

Feature Node.js Python
errorMode
correctOrientation
trimEdges
schema (extraction)
extractPerPage
custom_system_prompt

Proposed Implementation Path

Feature Approach
error_mode try/except per page with configurable raise/continue
schema + extract_per_page LiteLLM JSON mode / structured output support
correct_orientation pytesseract OSD detection
trim_edges Pillow getbbox() on image borders

Environment

  • Package: py-zerox (latest)
  • Reference: Node.js zerox npm package

Notes

  • This is a meta-tracking issue for the full Python parity gap — not a duplicate of any single issue.
  • LiteLLM (already a dependency) supports structured outputs, so schema support should be feasible without new dependencies.
  • Happy to open a draft PR for error_mode or schema if maintainers confirm the preferred API shape? @tylermaran @annapo23