Perform OCR using Google's Drive API v3
Project description
Google OCR (Drive API v3)
Perform OCR using Google’s Drive API v3
Free software: GNU General Public License v3
Documentation: https://google-drive-ocr.readthedocs.io.
Usage
To use google_drive_ocr
in a project:
from google_drive_ocr.application import GoogleOCRApplication app = GoogleOCRApplication('client_secret.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:
google-ocr --client-secret client_secret.json \ --upload-folder-id <google-drive-folder-id> \ --image-dir images/ --extension .jpg \ --workers 4 --no-keep # Save configuration and exit # If configuration is written to ~/.gdo.cfg, we don't have to specify those # options again on the subsequent runs google-ocr --client-secret client_secret.json --write-config ~/.gdo.cfg # Read configuration from a custom location (if it was written to a custom location) google-ocr --config ~/.my_config_file .. # Examples (assuming client-secret is saved in configuration file) # 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:
https://cloud.google.com/genomics/downloading-credentials-for-api-access
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for google_drive_ocr-0.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19c0996985da6f7bf9d8fb5f2e712ce12fca9f0d66f3375e37418fc47d488cba |
|
MD5 | 119312dbd382498f0d46b0fbea6653b6 |
|
BLAKE2b-256 | cfbeb97a601eb1e83eef71c68b4445d6ec3232c3b62ccab8ab0547894f648dc9 |