Skip to main content

Perform OCR using Google's Drive API v3

Project description

Google OCR (Drive API v3)

https://img.shields.io/pypi/v/google_drive_ocr.svg https://img.shields.io/travis/hrishikeshrt/google_drive_ocr.svg Documentation Status

Perform OCR using Google’s Drive API v3

Usage

To use google_drive_ocr in a project:

from google_drive_ocr.application import GoogleOCRApplication
app = GoogleOCRApplication('Google OCR', 'client_secrets.json')
# Single image
app.perform_ocr('image.png')
# Multiple images
app.perform_batch_ocr(['image_1.png', 'image_2.png', 'image_3.png'])
# Multiple Images using multiprocessing
app.perform_batch_ocr(['image_1.png', 'image_3.png', 'image_2.png'], workers=2)

To use google_drive_ocr from command line:

# Single image
google-ocr -i image.png

# Multiple images
google-ocr -b image_1.png image_2.png image_3.png

# All files from a directory
google-ocr --image-dir images/ --extension .png

# Multiple images using multiprocessing
google-ocr -b image_1.png image_2.png image_3.png --workers 2

# For more detailed Usage
google-ocr --help

Note: You must setup a Google application and download client_secrets.json file before using google_drive_ocr.

Setup Instructions

Create a project on Google Cloud Platform

Wizard: https://console.developers.google.com/start/api?id=drive

Instructions:

  • Select application type as “Installed Application”

  • Create credentials OAuth consent screen –> OAuth client ID

  • Save client_secret.json

Features

  • Perform OCR using Google’s Drive API v3

  • Single, Batch and Parallel OCR

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.0 (2021-06-14)

  • First release on PyPI.

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

google_drive_ocr-0.1.0.tar.gz (18.1 kB view hashes)

Uploaded Source

Built Distribution

google_drive_ocr-0.1.0-py2.py3-none-any.whl (11.7 kB view hashes)

Uploaded Python 2 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