Skip to main content

ocrmac (Apple Vision) OCR engine for OCR Bridge

Project description

OCR Bridge - ocrmac Engine

ocrmac (Apple Vision Framework) OCR engine for OCR Bridge.

Overview

This package provides an ocrmac engine that integrates with the OCR Bridge architecture. ocrmac uses Apple's Vision framework for OCR, providing excellent performance and accuracy on macOS systems.

Features

  • Native macOS: Uses Apple's Vision framework (macOS 10.15+)
  • LiveText Support: macOS Sonoma 14.0+ for enhanced accuracy
  • Multiple Formats: JPEG, PNG, TIFF, PDF
  • Fast Performance: ~131-207ms per image depending on mode
  • HOCR Output: Structured XML with bounding boxes

Platform Requirements

  • macOS 10.15+ for Vision framework (fast/balanced/accurate modes)
  • macOS Sonoma 14.0+ for LiveText framework

Installation

pip install ocrbridge-ocrmac

Note: macOS only! This package will not work on Windows or Linux.

Usage

The engine is automatically discovered by OCR Bridge via entry points.

Parameters

  • languages (list[str] | None): IETF BCP 47 codes (e.g., ["en-US"], ["zh-Hans"]) (default: None = auto-detect)
  • recognition_level (RecognitionLevel): fast/balanced/accurate/livetext (default: balanced)

Example

from pathlib import Path
from ocrbridge.engines.ocrmac import OcrmacEngine, OcrmacParams, RecognitionLevel

engine = OcrmacEngine()

# Process with defaults
hocr = engine.process(Path("document.pdf"))

# Process with custom parameters
params = OcrmacParams(
    languages=["en-US", "fr-FR"],
    recognition_level=RecognitionLevel.ACCURATE
)
hocr = engine.process(Path("document.pdf"), params)

# Use LiveText (macOS Sonoma 14.0+ only)
params_livetext = OcrmacParams(
    languages=["en-US"],
    recognition_level=RecognitionLevel.LIVETEXT
)
hocr = engine.process(Path("document.pdf"), params_livetext)

Version

0.1.0

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

ocrbridge_ocrmac-1.0.0.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

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

ocrbridge_ocrmac-1.0.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file ocrbridge_ocrmac-1.0.0.tar.gz.

File metadata

  • Download URL: ocrbridge_ocrmac-1.0.0.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ocrbridge_ocrmac-1.0.0.tar.gz
Algorithm Hash digest
SHA256 35280777f42503b268a82ac8c318754da3faf378dca3a6918bf4c0aafda8dba5
MD5 797c183931d189c1a114b1266ca61d88
BLAKE2b-256 8421d76972b3fa750b2418b8fac8bad6dfed77d746ff6cc15024021c232d23a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for ocrbridge_ocrmac-1.0.0.tar.gz:

Publisher: release.yml on OCRBridge/ocrbridge-ocrmac

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ocrbridge_ocrmac-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ocrbridge_ocrmac-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 771200f47cfa2f3bab6c29ac5bfa7e7989c8c3bf3d5352843cce5a6d6a3fca9c
MD5 57cfe9f6f9fdbbd39fc405a233e1f1a2
BLAKE2b-256 35d998212b77d57c3bf8cbf084ab7b6c619aeb5812454b7f60ef5d17346f085f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ocrbridge_ocrmac-1.0.0-py3-none-any.whl:

Publisher: release.yml on OCRBridge/ocrbridge-ocrmac

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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