Official Python SDK for the OCRQueen document extraction API
Project description
ocrqueen-python
Official Python SDK for the OCRQueen document and image extraction API.
🚧 Status: Pre-release. APIs and surface area will change before
v1.0.0.
Installation
pip install ocrqueen
Requires Python 3.10 or newer.
Supported formats
| Category | Formats |
|---|---|
| Documents | |
| Presentations | PPTX, PPT (PowerPoint) |
| Images | PNG, JPEG, WebP, HEIC / HEIF (iPhone photos) |
The API returns structured JSON + Markdown for every supported type —
text, tables, images, and (with extraction_profile="advanced")
diagram graph extraction and image alt-text.
Quickstart
from ocrqueen import OCRQueen
client = OCRQueen(api_key="pk_...")
with open("paper.pdf", "rb") as f:
job = client.extract.create(file=f)
result = client.jobs.wait(job)
print(result.result["markdown"])
Get an API key from dashboard.ocrqueen.com.
Other file types
# Slide decks — speaker notes are preserved
job = client.extract.create(file=open("pitch.pptx", "rb"))
# iPhone photos — HEIC handled natively, no conversion needed
job = client.extract.create(file=open("receipt.heic", "rb"))
# Scanned document images
job = client.extract.create(file=open("invoice.png", "rb"))
# Deeper extraction profile — diagrams, image alt-text, OCR on
# embedded text
job = client.extract.create(
file=open("paper.pdf", "rb"),
profile="advanced",
)
Patent extraction (domain="patent")
Route a PPTX or PDF through the patent-specific pipeline: region
classification (cover / abstract / drawings / claims / references),
Gemini cover parser, LibreOffice rasterisation for EMF/WMF figures,
cross-figure numeral resolution, and an honest per-stage
faithfulness_score. Billed flat at $0.05/page regardless of profile.
job = client.extract.create(
file=open("invention-disclosure.pptx", "rb"),
options={"domain": "patent"},
)
result = client.jobs.wait(job).result # response shape changes — discriminator is `domain`
patent = result # full PatentExtractionResponse
print(patent["source"]["input_kind"]) # "invention_disclosure" | "published_patent" | "unknown"
print(patent["extraction"]["faithfulness_score"])
# Figures carry a stable proxy URL — never expires until the underlying
# object is purged by your retention window. fetch_image() handles the
# 302 → signed-storage dance for you and returns raw bytes.
for fig in patent["drawings"]:
bytes_ = client.jobs.fetch_image(fig["image_url"])
open(f"{fig['figure_number'].replace(' ', '_')}.png", "wb").write(bytes_)
The same fetch_image() helper works for general-domain ImageBlock
URLs (pages[].blocks[].url) — useful for snapshotting all figures
from a job into your own pipeline.
Documentation
- Full API reference: https://ocrqueen.com/docs
- Python SDK guide: https://ocrqueen.com/docs/sdks/python
- Data retention & deletion: https://ocrqueen.com/docs/data-retention
License
MIT — see LICENSE.
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 ocrqueen-0.3.2.tar.gz.
File metadata
- Download URL: ocrqueen-0.3.2.tar.gz
- Upload date:
- Size: 68.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69b8949165753a208b1f211eef3af8291d120fcfe562c15bfd30d3ac4220082e
|
|
| MD5 |
01b6e34aea0b9a6299d90d6abd7c5f97
|
|
| BLAKE2b-256 |
f02b07dfb962bce8dadbcd9efecd8aeca926ed51596808179fde8cfe716b12e6
|
Provenance
The following attestation bundles were made for ocrqueen-0.3.2.tar.gz:
Publisher:
release.yml on ocrqueen/ocrqueen-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ocrqueen-0.3.2.tar.gz -
Subject digest:
69b8949165753a208b1f211eef3af8291d120fcfe562c15bfd30d3ac4220082e - Sigstore transparency entry: 1579241636
- Sigstore integration time:
-
Permalink:
ocrqueen/ocrqueen-python@54025a2b61dbd1923337a6d200786ea7dc7db15e -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/ocrqueen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@54025a2b61dbd1923337a6d200786ea7dc7db15e -
Trigger Event:
push
-
Statement type:
File details
Details for the file ocrqueen-0.3.2-py3-none-any.whl.
File metadata
- Download URL: ocrqueen-0.3.2-py3-none-any.whl
- Upload date:
- Size: 23.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
def852d589e80a4164f7a8f79fd18244e6463cd59b1cb037c1cfbe344be6710c
|
|
| MD5 |
6c03bfaed69e19f7ec3e57e3efae5f51
|
|
| BLAKE2b-256 |
f9e189a01292bda32089dfe5fc7cbe5f6a9d9772d97c0bff726d89718aaaa732
|
Provenance
The following attestation bundles were made for ocrqueen-0.3.2-py3-none-any.whl:
Publisher:
release.yml on ocrqueen/ocrqueen-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ocrqueen-0.3.2-py3-none-any.whl -
Subject digest:
def852d589e80a4164f7a8f79fd18244e6463cd59b1cb037c1cfbe344be6710c - Sigstore transparency entry: 1579241820
- Sigstore integration time:
-
Permalink:
ocrqueen/ocrqueen-python@54025a2b61dbd1923337a6d200786ea7dc7db15e -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/ocrqueen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@54025a2b61dbd1923337a6d200786ea7dc7db15e -
Trigger Event:
push
-
Statement type: