Python client library for interacting with the pdfRest API
Project description
pdfRest Python SDK
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.
- Homepage: pdfrest.com
- API docs: pdfrest.com/apidocs
- Python SDK docs: python.pdfrest.com
- API Lab: pdfrest.com/apilab
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 (
PdfRestClientandAsyncPdfRestClient). - 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()withPDFREST_API_KEY. - Self-hosted: set
base_url="https://your-api-host"and keep the same Python SDK surface.
Learn more
- API toolkit overview: pdfrest.com
- Resources and insights: pdfrest.com/resources
- Example scripts:
examples/README.md - Python SDK docs: python.pdfrest.com
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pdfrest-1.0.2.tar.gz.
File metadata
- Download URL: pdfrest-1.0.2.tar.gz
- Upload date:
- Size: 62.8 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94dfa576c7793d7a9223a9da80db37a9087f609df70e24bc2d1f52f0bf3f6344
|
|
| MD5 |
b72c55192e13b6faf92924c655625dc1
|
|
| BLAKE2b-256 |
de63b67cd0b01051be3ee08fcae8347075d2d1f2e1a2d05c65b9bad3fd886975
|
File details
Details for the file pdfrest-1.0.2-py3-none-any.whl.
File metadata
- Download URL: pdfrest-1.0.2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09bbfd66055ba5683faaa63fffd0b0564cde7e33885da63b09d962e4b8ffa5df
|
|
| MD5 |
7bcb6f0cfbf0936aa6d5cf766bb40b62
|
|
| BLAKE2b-256 |
0268a2e53d13281e1f8d6ffabf4080454cc1fa59075c6a196c28ff0d5524ceb4
|