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.
Metadata
Release files for ocrqueen 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ocrqueen-0.5.0.tar.gz | 71.2 kB | With provenance | Details for ocrqueen-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ocrqueen-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for ocrqueen-0.5.0-py3-none-any.whl |
Total release size: 96.2 kB
Release files / ocrqueen-0.5.0.tar.gz
| Download URL | ocrqueen-0.5.0.tar.gz |
|---|---|
| Size | 71.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4af4a802014261b1b69232b6b9819be1e1ed9ec798a310bd08ec25fd9c33dd27
|
|
BLAKE2b-256 checksum How to use checksums |
ced46a7b9ae532eb8c74e29cdba1962fee26d76adcf3ad3fb1846ebb14f9b77e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 21, 2026.
Transparency logRelease files / ocrqueen-0.5.0-py3-none-any.whl
| Download URL | ocrqueen-0.5.0-py3-none-any.whl |
|---|---|
| Size | 25.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a69a587599b3eeca9eb8d6f7f960d7b7d06de3197755653bc04c92e78c0a4aff
|
|
BLAKE2b-256 checksum How to use checksums |
5e2cf5fa12233648627d32f448f69f77ec5250435f13456167c70ff5b8e56f3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 21, 2026.
Transparency logSecurity for ocrqueen 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for ocrqueen-0.5.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 21, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.