Skip to main content

ocr-software-haystack: read PDFs and scans in a Haystack pipeline

A Haystack component (guide) that sends PDF, PNG, JPEG or TIFF files to the ocr-software.com OCR API and returns one Document per page. The files leave your machine for the API (Helsinki, EU), or for your own server if you set base_url.

pip install ocr-software-haystack
export OCR_SOFTWARE_API_KEY=ocr_...        # get a key at https://ocr-software.com/order/
from ocr_software_haystack import OcrSoftwareConverter

converter = OcrSoftwareConverter()          # no pipeline given: the cheapest available one, named in the log and in meta
documents = converter.run(sources=["scan.pdf"])["documents"]
print(documents[0].content, documents[0].meta)   # meta: file_path, pipeline, page (1-based)
  • pipeline: optional, name@version. Without it the cheapest available pipeline is used and logged (same rule as the ocr-software command). The list: ocr-software --list-pipelines.
  • format: "text" (default) or "md"; Markdown works with scan-ctc@2 too (only ## Page N headings) and with scan-vlm-ctc@2 (headings, tables, more layout).
  • split_pages: True (default) gives one Document per page with meta["page"], counted from 1, so a RAG answer can cite "page 4". False gives one Document per file. The text result separates pages with a form feed (\f), the Markdown result starts each page with ## Page N; the component splits at exactly these marks.
  • base_url: default https://api.ocr-software.com; for your own server e.g. http://127.0.0.1:8080.
  • Files are read one after the other, so at most one job is open at the API. A page that failed does not stop the run; the Document then has meta["incomplete"] with the reason. A file that is missing, empty or not a PDF, PNG, JPEG or TIFF is skipped with a log warning, unless on_error="raise" is set, which stops at the first such file with an OcrError. If every file was skipped, the run raises OcrError instead of returning an empty list. A wrong key or address always stops the run; import OcrError from ocr_software_haystack.
  • Wrong API keys: after several wrong keys from one address the service answers 429 locked_out with Retry-After for wrong keys from that address (a correct key still works, also from the same office network). Do not retry in a loop; fix the key.
  • The component works in a Pipeline; to_dict and from_dict keep the key out of the file, it is read from the environment. Haystack 3 loads only trusted modules from YAML: Pipeline.loads(text, allowed_modules=["ocr_software_haystack"]).

Tests (fake local service, no network, no key): pip install -e ".[test]" and python -m pytest -p no:cacheprovider .

MIT, see LICENSE. Operated by Helm & Nagel GmbH. Terms · Privacy · Imprint · Security

Metadata

Release files for ocr-software-haystack 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ocr-software-haystack 0.1.0
File Size Uploaded Provenance Actions
ocr_software_haystack-0.1.0.tar.gz 7.4 kB With provenance Details for ocr_software_haystack-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ocr-software-haystack 0.1.0
File Interpreter ABI Platform Actions
ocr_software_haystack-0.1.0-py3-none-any.whl Python 3 none any Details for ocr_software_haystack-0.1.0-py3-none-any.whl

Total release size: 13.4 kB

Release files / ocr_software_haystack-0.1.0.tar.gz

Download URL ocr_software_haystack-0.1.0.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7c84f5aeb68f663e6e89a0d7b93317b40e54494e20710fb887d9abfc621f8532
BLAKE2b-256 checksum
How to use checksums
cbdca8515ea163ce82ef908c876e76def3b4fbbcbb7a12b1ae6d0751b02dd4a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Nov 13, 2026.

Transparency log

Release files / ocr_software_haystack-0.1.0-py3-none-any.whl

Download URL ocr_software_haystack-0.1.0-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
22accda46a7edb17a1323ac083f2ab588e6db8b950bc5a9ff7db8dce71e0f05e
BLAKE2b-256 checksum
How to use checksums
c9c8b22242d694e956049bf4744b2b2558b2048965fd3f241565bef14f8e48ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Nov 13, 2026.

Transparency log

Security for ocr-software-haystack 0.1.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.

Select from 2 files

Attestation for ocr_software_haystack-0.1.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 Nov 13, 2026.

Transparency log

A 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page