Skip to main content

OCR Package

This Python package allows you to perform OCR on images using Tesseract and interpret the results using generative AI models like OpenAI's GPT and Google's Gemini.

Installation

To install the package, use:

pip install ocr_genAI

Usage

from ocr_genai import perform_ocr, interpret_with_openai, interpret_with_gemini,interpret_with_claude



# Replace with your actual image path and API keys
image_path = "image.jpg"  # Ensure this image exists in your directory
openai_api_key = "YOUR_OPENAI_API_KEY"
gemini_api_key = "YOUR_GEMINI_API_KEY"
claude_api_key = "YOUR_CLAUDE_API_KEY"

# Perform OCR
ocr_output = perform_ocr(image_path)
if ocr_output:
    print("OCR Output:\n", ocr_output)

    # Interpret with OpenAI
    openai_response = interpret_with_openai(ocr_output, openai_api_key)
    if openai_response:
        print("OpenAI Response:\n", openai_response)

    # Interpret with Gemini
    gemini_response = interpret_with_gemini(ocr_output, gemini_api_key)
    if gemini_response:
        print("Gemini Response:\n", gemini_response)
    #interpret with Claude
    claude_response = interpret_with_claude(ocr_output, claude_api_key)
        if claude_response:
            print("Claude Response:\n", claude_response)

Metadata

Release files for ocr-genai-beta 0.1.4

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-genai-beta 0.1.4
File Size Uploaded
ocr-genai-beta-0.1.4.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ocr-genai-beta 0.1.4
File Interpreter ABI Platform
ocr_genai_beta-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 6.8 kB

Release files / ocr-genai-beta-0.1.4.tar.gz

Download URL ocr-genai-beta-0.1.4.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d59461bbbe77b8cce45b0efafff82a22befbc745c8a53a25fd70295f8bdcb7dc
BLAKE2b-256 checksum
How to use checksums
c784c08210bffa7e1c83e9e3452063c0a4b9955053e7b4e06d1afab946d1f675
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release files / ocr_genai_beta-0.1.4-py3-none-any.whl

Download URL ocr_genai_beta-0.1.4-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
721da713b8bb8eed44d629fcebcdd1d270117f108d1194e3fdde3952b06dee6b
BLAKE2b-256 checksum
How to use checksums
3ade48e158031fa4e84b0946425344c32c9edbb7ec53d9f587c40f91d2cbe413
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.0.1

2 release files

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