Skip to main content

A simple Theos library using Theos API

Project description

TheosOCR

This is a simple OCR library that uses the Theos OCR API to extract text from images.

Installation

pip install theosocr

use

from theosocr import theos_ocr_file, theos_ocr_base64

# OCR işlemi yapılacak dosya adı
file_path = 'path_to_your_image.png'

# Dosya yoluyla OCR iÅŸlemi
result_file = theos_ocr_file(file_path)

# Base64 stringi oluÅŸturma
def image_to_base64(file_path):
    with open(file_path, 'rb') as image_file:
        base64_bytes = base64.b64encode(image_file.read())
        base64_string = base64_bytes.decode('utf-8')
    return base64_string

base64_image = image_to_base64(file_path)

# Base64 ile OCR iÅŸlemi
result_base64 = theos_ocr_base64(base64_image)

# Sonuçları yazdırın
print("Dosya yoluyla OCR Sonucu:")
print(result_file)

print("\nBase64 ile OCR Sonucu:")
print(result_base64)

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

theosocr-1.0.tar.gz (1.7 kB view hashes)

Uploaded Source

Built Distribution

theosocr-1.0-py3-none-any.whl (1.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page