Metadata-Version: 2.4
Name: ocrbridge-ocrmac
Version: 1.0.0
Summary: ocrmac (Apple Vision) OCR engine for OCR Bridge
License: MIT
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: ocrbridge-core>=0.1.0
Requires-Dist: ocrmac>=0.2.2
Requires-Dist: pdf2image>=1.17.0
Requires-Dist: pillow>=10.0.0
Provides-Extra: build
Requires-Dist: hatchling; extra == 'build'
Provides-Extra: dev
Requires-Dist: pyright>=1.1.0; extra == 'dev'
Requires-Dist: pytest-cov>=7.0.0; extra == 'dev'
Requires-Dist: pytest~=8.0; extra == 'dev'
Requires-Dist: python-semantic-release>=10.5.2; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Provides-Extra: test
Requires-Dist: pytest~=8.0; extra == 'test'
Description-Content-Type: text/markdown

# 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

```bash
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

```python
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
