SuperAPIAI Directory

oxidize-python

github.com · AI developer platforms

PDF toolkit: create and analyze PDFs, extract text for RAG, convert to Markdown, split and merge pages, add annotations and form fields, and encrypt files.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsmacOS · Linux · API

About this tool

oxidize-python is the Python binding for oxidize-pdf, using a Rust core to provide native performance for generating, parsing, splitting, merging, and manipulating PDFs. It does not depend on C libraries, Java, or subprocess calls. The current version 0.22.0 pins the Rust core to 5.4.2 and uses the MIT-licensed oxidize-webpki RustCrypto provider for certificate verification. Supported platforms include Linux (x86_64, aarch64), macOS (x86_64, Apple Silicon), and Windows (x86_64), and it requires Python 3.10+.

Main capabilities:

  • Generate, parse, split, merge, and manipulate PDFs.
  • Extract text for RAG, with support for explicit text recovery and non-breaking space normalization.
  • Convert to Markdown.
  • Add annotations and form fields.
  • Encrypt files (note: write encryption support is limited, see limitations).
  • Built-in MCP server exposing 12 tools, 5 static resources plus one session resource template, and 5 prompts, running over stdio, enabling AI agents to work with PDFs directly.

Usage:

  • Installation: install oxidize-pdf for the base library; for MCP functionality, install oxidize-pdf[mcp] to include dependencies.
  • The MCP server is configured via environment variables, and resource limits (OXIDIZE_MAX_*) can prevent oversized or malicious PDFs, returning a RESOURCE_LIMIT error when exceeded.
  • Integration methods:
    • Claude Desktop: add configuration in claude_desktop_config.json.
    • GitHub Copilot (VS Code): add .vscode/mcp.json in the workspace, switch to Agent mode in the Chat view, and the 12 PDF tools will appear in the tool picker.
    • OpenAI Agents SDK: start the server over stdio and expose tools to the agent; see examples/openai_agents_quickstart.py for a runnable example.
  • Custom JSON-RPC client: send initialize, wait for the response, then send notifications/initialized, then send tools/list. Read newline-delimited JSON-RPC from stdout, keep stderr separate; the startup banner is written to stderr.
  • Resources: oxidize://fonts, oxidize://page-sizes, oxidize://capabilities, oxidize://version, oxidize://workspace, oxidize://session/{id}.
  • Exception hierarchy: PdfError > PdfIoError, PdfParseError, PdfEncryptionError, PdfPermissionError.

Use cases:

  • Workflows where AI agents need to process PDFs, such as summarization, data extraction, and form filling.
  • Pipelines that need to extract PDF text for RAG or convert it to Markdown.
  • Document processing tasks that require splitting, merging, annotation, and form field operations.

Limitations:

  • Encrypted write support: Document.encrypt() configures encryption parameters, but the underlying Rust library does not yet serialize the encryption dictionary into the PDF output; reading encrypted PDFs works normally.
  • Image extraction returns the raw embedded stream: extract_images_from_pdf extracts each embedded image as-is (for example, DCTDecode JPEG is written byte-for-byte). Image preprocessing (automatic rotation correction, contrast enhancement, denoising, upscaling, forced grayscale) is unavailable because the build excludes the upstream external-images feature and its image crate dependency. This keeps extraction faithful and lossless and does not silently return empty or stub results.
  • Only CPython is supported: PyPy and GraalPy are not supported.
  • This package does not provide a hosted HTTP endpoint; ChatGPT web requires a remote connection, and developer mode testing can also use Secure MCP Tunnel with a local stdio server. This migration did not publish a ChatGPT plugin.
  • In older installations, tools/list returns an empty array (issue #198); upgrading to 0.20.0 or newer fixes it. On Windows, installation and startup must use the same Python environment.

License: MIT。

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools