Skip to content

Commit

Permalink
Added 2.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Cloudmersive committed Jul 21, 2019
1 parent 386c723 commit 867a026
Show file tree
Hide file tree
Showing 12 changed files with 517 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The powerful Optical Character Recognition (OCR) APIs let you convert scanned im
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: v1
- Package version: 2.0.5
- Package version: 2.0.6
- Build package: io.swagger.codegen.languages.PythonClientCodegen

## Requirements.
Expand Down Expand Up @@ -80,6 +80,7 @@ Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*ImageOcrApi* | [**image_ocr_image_lines_with_location**](docs/ImageOcrApi.md#image_ocr_image_lines_with_location) | **POST** /ocr/image/to/lines-with-location | Convert a scanned image into words with location
*ImageOcrApi* | [**image_ocr_image_words_with_location**](docs/ImageOcrApi.md#image_ocr_image_words_with_location) | **POST** /ocr/image/to/words-with-location | Convert a scanned image into words with location
*ImageOcrApi* | [**image_ocr_photo_recognize_business_card**](docs/ImageOcrApi.md#image_ocr_photo_recognize_business_card) | **POST** /ocr/photo/recognize/business-card | Recognize a photo of a business card, extract key business information
*ImageOcrApi* | [**image_ocr_photo_recognize_receipt**](docs/ImageOcrApi.md#image_ocr_photo_recognize_receipt) | **POST** /ocr/photo/recognize/receipt | Recognize a photo of a receipt, extract key business information
*ImageOcrApi* | [**image_ocr_photo_to_text**](docs/ImageOcrApi.md#image_ocr_photo_to_text) | **POST** /ocr/photo/toText | Convert a photo of a document into text
*ImageOcrApi* | [**image_ocr_photo_words_with_location**](docs/ImageOcrApi.md#image_ocr_photo_words_with_location) | **POST** /ocr/photo/to/words-with-location | Convert a photo of a document or receipt into words with location
Expand All @@ -97,6 +98,7 @@ Class | Method | HTTP request | Description

## Documentation For Models

- [BusinessCardRecognitionResult](docs/BusinessCardRecognitionResult.md)
- [GetPageAngleResult](docs/GetPageAngleResult.md)
- [ImageToLinesWithLocationResult](docs/ImageToLinesWithLocationResult.md)
- [ImageToTextResponse](docs/ImageToTextResponse.md)
Expand Down
1 change: 1 addition & 0 deletions cloudmersive_ocr_api_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from cloudmersive_ocr_api_client.api_client import ApiClient
from cloudmersive_ocr_api_client.configuration import Configuration
# import models into sdk package
from cloudmersive_ocr_api_client.models.business_card_recognition_result import BusinessCardRecognitionResult
from cloudmersive_ocr_api_client.models.get_page_angle_result import GetPageAngleResult
from cloudmersive_ocr_api_client.models.image_to_lines_with_location_result import ImageToLinesWithLocationResult
from cloudmersive_ocr_api_client.models.image_to_text_response import ImageToTextResponse
Expand Down
99 changes: 99 additions & 0 deletions cloudmersive_ocr_api_client/api/image_ocr_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,105 @@ def image_ocr_image_words_with_location_with_http_info(self, image_file, **kwarg
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)

def image_ocr_photo_recognize_business_card(self, image_file, **kwargs): # noqa: E501
"""Recognize a photo of a business card, extract key business information # noqa: E501
Analyzes a photograph of a business card as input, and outputs key business information such as the name of the person, name of the business, the address of the business, the phone number, the email address and more. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.image_ocr_photo_recognize_business_card(image_file, async_req=True)
>>> result = thread.get()
:param async_req bool
:param file image_file: Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. (required)
:return: BusinessCardRecognitionResult
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.image_ocr_photo_recognize_business_card_with_http_info(image_file, **kwargs) # noqa: E501
else:
(data) = self.image_ocr_photo_recognize_business_card_with_http_info(image_file, **kwargs) # noqa: E501
return data

def image_ocr_photo_recognize_business_card_with_http_info(self, image_file, **kwargs): # noqa: E501
"""Recognize a photo of a business card, extract key business information # noqa: E501
Analyzes a photograph of a business card as input, and outputs key business information such as the name of the person, name of the business, the address of the business, the phone number, the email address and more. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.image_ocr_photo_recognize_business_card_with_http_info(image_file, async_req=True)
>>> result = thread.get()
:param async_req bool
:param file image_file: Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. (required)
:return: BusinessCardRecognitionResult
If the method is called asynchronously,
returns the request thread.
"""

all_params = ['image_file'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')

params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method image_ocr_photo_recognize_business_card" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'image_file' is set
if ('image_file' not in params or
params['image_file'] is None):
raise ValueError("Missing the required parameter `image_file` when calling `image_ocr_photo_recognize_business_card`") # noqa: E501

collection_formats = {}

path_params = {}

query_params = []

header_params = {}

form_params = []
local_var_files = {}
if 'image_file' in params:
local_var_files['imageFile'] = params['image_file'] # noqa: E501

body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json', 'text/json', 'application/xml', 'text/xml']) # noqa: E501

# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['multipart/form-data']) # noqa: E501

# Authentication setting
auth_settings = ['Apikey'] # noqa: E501

return self.api_client.call_api(
'/ocr/photo/recognize/business-card', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='BusinessCardRecognitionResult', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)

def image_ocr_photo_recognize_receipt(self, image_file, **kwargs): # noqa: E501
"""Recognize a photo of a receipt, extract key business information # noqa: E501
Expand Down
2 changes: 1 addition & 1 deletion cloudmersive_ocr_api_client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'Swagger-Codegen/2.0.5/python'
self.user_agent = 'Swagger-Codegen/2.0.6/python'

def __del__(self):
if self._pool is not None:
Expand Down
2 changes: 1 addition & 1 deletion cloudmersive_ocr_api_client/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,5 +240,5 @@ def to_debug_report(self):
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: v1\n"\
"SDK Package Version: 2.0.5".\
"SDK Package Version: 2.0.6".\
format(env=sys.platform, pyversion=sys.version)
1 change: 1 addition & 0 deletions cloudmersive_ocr_api_client/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from __future__ import absolute_import

# import models into model package
from cloudmersive_ocr_api_client.models.business_card_recognition_result import BusinessCardRecognitionResult
from cloudmersive_ocr_api_client.models.get_page_angle_result import GetPageAngleResult
from cloudmersive_ocr_api_client.models.image_to_lines_with_location_result import ImageToLinesWithLocationResult
from cloudmersive_ocr_api_client.models.image_to_text_response import ImageToTextResponse
Expand Down
Loading

0 comments on commit 867a026

Please sign in to comment.