Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cloudmersive-ocr-api-client

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudmersive-ocr-api-client

  • 2.0.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

cloudmersive-ocr-api-client

CloudmersiveOcrApiClient - the Ruby gem for the ocrapi

The powerful Optical Character Recognition (OCR) APIs let you convert scanned images of pages into recognized text.

This SDK is automatically generated by the Swagger Codegen project:

  • API version: v1
  • Package version: 2.0.2
  • Build package: io.swagger.codegen.languages.RubyClientCodegen

Installation

Build a gem

To build the Ruby code into a gem:

gem build cloudmersive-ocr-api-client.gemspec

Then either install the gem locally:

gem install ./cloudmersive-ocr-api-client-2.0.2.gem

(for development, run gem install --dev ./cloudmersive-ocr-api-client-2.0.2.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'cloudmersive-ocr-api-client', '~> 2.0.2'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'cloudmersive-ocr-api-client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'cloudmersive-ocr-api-client'

# Setup authorization
CloudmersiveOcrApiClient.configure do |config|
  # Configure API key authorization: Apikey
  config.api_key['Apikey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['Apikey'] = 'Bearer'
end

api_instance = CloudmersiveOcrApiClient::ImageOcrApi.new

image_file = File.new('/path/to/file.txt') # File | Image file to perform OCR on.  Common file formats such as PNG, JPEG are supported.

opts = { 
  language: 'language_example', # String | Optional, language of the input document, default is English (ENG).  Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
  preprocessing: 'preprocessing_example' # String | Optional, preprocessing mode, default is 'Auto'.  Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended).
}

begin
  #Convert a scanned image into words with location
  result = api_instance.image_ocr_image_lines_with_location(image_file, opts)
  p result
rescue CloudmersiveOcrApiClient::ApiError => e
  puts "Exception when calling ImageOcrApi->image_ocr_image_lines_with_location: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://api.cloudmersive.com

ClassMethodHTTP requestDescription
CloudmersiveOcrApiClient::ImageOcrApiimage_ocr_image_lines_with_locationPOST /ocr/image/to/lines-with-locationConvert a scanned image into words with location
CloudmersiveOcrApiClient::ImageOcrApiimage_ocr_image_words_with_locationPOST /ocr/image/to/words-with-locationConvert a scanned image into words with location
CloudmersiveOcrApiClient::ImageOcrApiimage_ocr_photo_recognize_business_cardPOST /ocr/photo/recognize/business-cardRecognize a photo of a business card, extract key business information
CloudmersiveOcrApiClient::ImageOcrApiimage_ocr_photo_recognize_formPOST /ocr/photo/recognize/formRecognize a photo of a form, extract key fields and business information
CloudmersiveOcrApiClient::ImageOcrApiimage_ocr_photo_recognize_form_advancedPOST /ocr/photo/recognize/form/advancedRecognize a photo of a form, extract key fields using stored templates
CloudmersiveOcrApiClient::ImageOcrApiimage_ocr_photo_recognize_receiptPOST /ocr/photo/recognize/receiptRecognize a photo of a receipt, extract key business information
CloudmersiveOcrApiClient::ImageOcrApiimage_ocr_photo_to_textPOST /ocr/photo/toTextConvert a photo of a document into text
CloudmersiveOcrApiClient::ImageOcrApiimage_ocr_photo_words_with_locationPOST /ocr/photo/to/words-with-locationConvert a photo of a document or receipt into words with location
CloudmersiveOcrApiClient::ImageOcrApiimage_ocr_postPOST /ocr/image/toTextConvert a scanned image into text
CloudmersiveOcrApiClient::PdfOcrApipdf_ocr_pdf_to_lines_with_locationPOST /ocr/pdf/to/lines-with-locationConvert a PDF into text lines with location
CloudmersiveOcrApiClient::PdfOcrApipdf_ocr_pdf_to_words_with_locationPOST /ocr/pdf/to/words-with-locationConvert a PDF into words with location
CloudmersiveOcrApiClient::PdfOcrApipdf_ocr_postPOST /ocr/pdf/toTextConverts an uploaded PDF file into text via Optical Character Recognition.
CloudmersiveOcrApiClient::PreprocessingApipreprocessing_binarizePOST /ocr/preprocessing/image/binarizeConvert an image of text into a binarized (light and dark) view
CloudmersiveOcrApiClient::PreprocessingApipreprocessing_binarize_advancedPOST /ocr/preprocessing/image/binarize/advancedConvert an image of text into a binary (light and dark) view with ML
CloudmersiveOcrApiClient::PreprocessingApipreprocessing_get_page_anglePOST /ocr/preprocessing/image/get-page-angleGet the angle of the page / document / receipt
CloudmersiveOcrApiClient::PreprocessingApipreprocessing_unrotatePOST /ocr/preprocessing/image/unrotateDetect and unrotate a document image
CloudmersiveOcrApiClient::PreprocessingApipreprocessing_unrotate_advancedPOST /ocr/preprocessing/image/unrotate/advancedDetect and unrotate a document image (advanced)
CloudmersiveOcrApiClient::PreprocessingApipreprocessing_unskewPOST /ocr/preprocessing/image/unskewDetect and unskew a photo of a document
CloudmersiveOcrApiClient::ReceiptsApireceipts_photo_to_csvPOST /ocr/receipts/photo/to/csvConvert a photo of a receipt into a CSV file containing structured information from the receipt

Documentation for Models

Documentation for Authorization

Apikey

  • Type: API key
  • API key parameter name: Apikey
  • Location: HTTP header

FAQs

Package last updated on 03 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc