ocrmac is a Python wrapper designed to extract text from images specifically on macOS systems. It leverages Apple's Vision framework to provide fast and accurate Optical Character Recognition (OCR) capabilities. The library is currently at version 1.0.1 and maintains an active development and release cadence, with updates addressing features and bug fixes. It requires macOS 10.15 (Catalina) or newer.
pip install ocrmacVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `ocrmac` to extract text from an image. It covers both the class-based `ocrmac.OCR` approach and the functional `ocrmac.text_from_image` method, including setting language preferences. A dummy image is created for a runnable example.
Ensure deployment on a compatible macOS system (10.15 or newer).
Consult the `ocrmac` documentation or source code for a list of supported language codes (e.g., 'en-US', 'zh-Hans', 'de-DE').
Choose the `recognition_level` ('fast' or 'accurate') that best suits your application's requirements for speed versus accuracy. Default is 'accurate'.When utilizing specific features or performance characteristics, ensure you explicitly set the `framework` parameter (e.g., `framework='livetext'`) in the `OCR` constructor or `text_from_image` function.