Skip to main content

Python client library for interacting with the pdfRest API

Project description

pdfRest Python SDK

Tests PyPI Version Python Versions llms.txt

Build production-grade PDF automation with the official Python SDK for pdfRest: a powerful PDF API platform for conversion, OCR, extraction, redaction, security, forms, and AI-ready document workflows.

Why pdfRest

  • Enterprise PDF quality powered by Adobe PDF Library technology.
  • Fast onboarding with API Lab, code samples, and straightforward REST patterns.
  • Chainable API workflows that let you pass outputs between calls.
  • Deployment flexibility: Cloud, self-hosted on AWS, or self-hosted container.
  • Security and compliance resources published in the trust center and product documentation.

Why this SDK

  • Official typed Python interface to pdfRest (PdfRestClient and AsyncPdfRestClient).
  • Pydantic-backed request/response models for safer integrations.
  • High-level helpers for the endpoints teams use most in production.
  • Consistent error handling, request customization, and file management helpers.

What you can build

Use this PDF API for workflows like:

  • Convert and transform: PDF to Word/Excel/PowerPoint/images/Markdown, and convert files to PDF/PDF-A/PDF-X.
  • Extract and analyze: OCR, text extraction, image extraction, PDF metadata.
  • Secure and govern: redaction, encryption, permissions, signing, watermarking.
  • Compose and optimize: merge/split, compress, flatten, rasterize, color conversion.
  • Form operations: import/export form data, flatten forms, XFA to Acroforms.

Built for AI and LLM pipelines

pdfRest is especially useful for document AI systems:

  • Convert PDFs to structured Markdown for downstream retrieval and training data prep.
  • Extract clean text and metadata for indexing and chunking pipelines.
  • Summarize and translate document content with API-native operations.
  • Keep multi-step pipelines efficient by chaining outputs between operations.

Installation

pdfrest supports Python 3.10+.

Recommended (uv):

uv add pdfrest

Fallback (pip):

pip install pdfrest

Quick start

Set your API key in PDFREST_API_KEY:

export PDFREST_API_KEY="your-api-key"

Run your script:

uv run python your_script.py

Example (upload + extract text):

from pathlib import Path

from pdfrest import PdfRestClient

with PdfRestClient() as client:
    uploaded = client.files.create_from_paths([Path("input.pdf")])[0]
    result = client.extract_pdf_text(uploaded, full_text="document")

preview = ""
if result.full_text is not None and result.full_text.document_text is not None:
    preview = result.full_text.document_text[:500]
print(preview)

Async example:

import asyncio
from pathlib import Path

from pdfrest import AsyncPdfRestClient


async def main() -> None:
    async with AsyncPdfRestClient() as client:
        uploaded = (await client.files.create_from_paths([Path("input.pdf")]))[0]
        result = await client.extract_pdf_text(uploaded, full_text="document")
        preview = ""
        if result.full_text is not None and result.full_text.document_text is not None:
            preview = result.full_text.document_text[:500]
        print(preview)


asyncio.run(main())

Deployment options

  • Cloud (default): use PdfRestClient() with PDFREST_API_KEY.
  • Self-hosted: set base_url="https://your-api-host" and keep the same Python SDK surface.

Learn more

For contributors

Contributor workflows live in CONTRIBUTING.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdfrest-1.0.3.tar.gz (62.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdfrest-1.0.3-py3-none-any.whl (65.1 kB view details)

Uploaded Python 3

File details

Details for the file pdfrest-1.0.3.tar.gz.

File metadata

  • Download URL: pdfrest-1.0.3.tar.gz
  • Upload date:
  • Size: 62.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pdfrest-1.0.3.tar.gz
Algorithm Hash digest
SHA256 0a9f1e01816b3d48eabc0f3c532b71a4d109527f0e11c39d9f382f45a5283bf8
MD5 bba3aafb857424c2b6c10bdaa07ea8dd
BLAKE2b-256 1ba5a1eb6fb44c90f9d36b78529da4da5cfefcbd72f2faa592b66ba4f12922af

See more details on using hashes here.

File details

Details for the file pdfrest-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: pdfrest-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 65.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pdfrest-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e0554dd6466b36f584363e8f7f44ed7cf1b923795faafe8852b87f8bbc573d54
MD5 00867b760e64f8e747de3381693eb7cd
BLAKE2b-256 f61947b954a64e1a9cd5e0c5c09717d1d35102909e5315d5101f0b9ce3920940

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page