Skip to content

Commit

Permalink
Added 2.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Cloudmersive committed Jul 12, 2019
1 parent b11e861 commit e69d25d
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 11 deletions.
2 changes: 1 addition & 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.3
- Package version: 2.0.4
- Build package: io.swagger.codegen.languages.PythonClientCodegen

## Requirements.
Expand Down
6 changes: 5 additions & 1 deletion cloudmersive_ocr_api_client/api/image_ocr_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ def image_ocr_photo_words_with_location(self, image_file, **kwargs): # noqa: E5
:param file image_file: Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. (required)
:param str language: 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)
:param str preprocessing: 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).
:param str diagnostics: Optional, diagnostics mode, default is 'false'. Possible values are 'true' (will set DiagnosticImage to a diagnostic PNG image in the result), and 'false' (no diagnostics are enabled; this is recommended for best performance).
:return: PhotoToWordsWithLocationResult
If the method is called asynchronously,
returns the request thread.
Expand All @@ -387,12 +388,13 @@ def image_ocr_photo_words_with_location_with_http_info(self, image_file, **kwarg
:param file image_file: Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. (required)
:param str language: 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)
:param str preprocessing: 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).
:param str diagnostics: Optional, diagnostics mode, default is 'false'. Possible values are 'true' (will set DiagnosticImage to a diagnostic PNG image in the result), and 'false' (no diagnostics are enabled; this is recommended for best performance).
:return: PhotoToWordsWithLocationResult
If the method is called asynchronously,
returns the request thread.
"""

all_params = ['image_file', 'language', 'preprocessing'] # noqa: E501
all_params = ['image_file', 'language', 'preprocessing', 'diagnostics'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
Expand Down Expand Up @@ -423,6 +425,8 @@ def image_ocr_photo_words_with_location_with_http_info(self, image_file, **kwarg
header_params['language'] = params['language'] # noqa: E501
if 'preprocessing' in params:
header_params['preprocessing'] = params['preprocessing'] # noqa: E501
if 'diagnostics' in params:
header_params['diagnostics'] = params['diagnostics'] # noqa: E501

form_params = []
local_var_files = {}
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.3/python'
self.user_agent = 'Swagger-Codegen/2.0.4/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.3".\
"SDK Package Version: 2.0.4".\
format(env=sys.platform, pyversion=sys.version)
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,30 @@ class PhotoToWordsWithLocationResult(object):
"""
swagger_types = {
'successful': 'bool',
'text_elements': 'list[OcrPhotoTextElement]'
'text_elements': 'list[OcrPhotoTextElement]',
'diagnostic_image': 'str'
}

attribute_map = {
'successful': 'Successful',
'text_elements': 'TextElements'
'text_elements': 'TextElements',
'diagnostic_image': 'DiagnosticImage'
}

def __init__(self, successful=None, text_elements=None): # noqa: E501
def __init__(self, successful=None, text_elements=None, diagnostic_image=None): # noqa: E501
"""PhotoToWordsWithLocationResult - a model defined in Swagger""" # noqa: E501

self._successful = None
self._text_elements = None
self._diagnostic_image = None
self.discriminator = None

if successful is not None:
self.successful = successful
if text_elements is not None:
self.text_elements = text_elements
if diagnostic_image is not None:
self.diagnostic_image = diagnostic_image

@property
def successful(self):
Expand Down Expand Up @@ -98,6 +103,31 @@ def text_elements(self, text_elements):

self._text_elements = text_elements

@property
def diagnostic_image(self):
"""Gets the diagnostic_image of this PhotoToWordsWithLocationResult. # noqa: E501
Typically null. To analyze OCR performance, enable diagnostic mode by adding the HTTP header \"DiagnosticMode\" with the value \"true\". When this is true, a diagnostic image showing the details of the OCR result will be set in PNG format into DiagnosticImage. # noqa: E501
:return: The diagnostic_image of this PhotoToWordsWithLocationResult. # noqa: E501
:rtype: str
"""
return self._diagnostic_image

@diagnostic_image.setter
def diagnostic_image(self, diagnostic_image):
"""Sets the diagnostic_image of this PhotoToWordsWithLocationResult.
Typically null. To analyze OCR performance, enable diagnostic mode by adding the HTTP header \"DiagnosticMode\" with the value \"true\". When this is true, a diagnostic image showing the details of the OCR result will be set in PNG format into DiagnosticImage. # noqa: E501
:param diagnostic_image: The diagnostic_image of this PhotoToWordsWithLocationResult. # noqa: E501
:type: str
"""
if diagnostic_image is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', diagnostic_image): # noqa: E501
raise ValueError(r"Invalid value for `diagnostic_image`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501

self._diagnostic_image = diagnostic_image

def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
Expand Down
6 changes: 4 additions & 2 deletions docs/ImageOcrApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **image_ocr_photo_words_with_location**
> PhotoToWordsWithLocationResult image_ocr_photo_words_with_location(image_file, language=language, preprocessing=preprocessing)
> PhotoToWordsWithLocationResult image_ocr_photo_words_with_location(image_file, language=language, preprocessing=preprocessing, diagnostics=diagnostics)
Convert a photo of a document or receipt into words with location

Expand All @@ -209,10 +209,11 @@ api_instance = cloudmersive_ocr_api_client.ImageOcrApi(cloudmersive_ocr_api_clie
image_file = '/path/to/file.txt' # file | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
language = 'language_example' # str | 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) (optional)
preprocessing = 'preprocessing_example' # str | 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). (optional)
diagnostics = 'diagnostics_example' # str | Optional, diagnostics mode, default is 'false'. Possible values are 'true' (will set DiagnosticImage to a diagnostic PNG image in the result), and 'false' (no diagnostics are enabled; this is recommended for best performance). (optional)

try:
# Convert a photo of a document or receipt into words with location
api_response = api_instance.image_ocr_photo_words_with_location(image_file, language=language, preprocessing=preprocessing)
api_response = api_instance.image_ocr_photo_words_with_location(image_file, language=language, preprocessing=preprocessing, diagnostics=diagnostics)
pprint(api_response)
except ApiException as e:
print("Exception when calling ImageOcrApi->image_ocr_photo_words_with_location: %s\n" % e)
Expand All @@ -225,6 +226,7 @@ Name | Type | Description | Notes
**image_file** | **file**| Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. |
**language** | **str**| 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) | [optional]
**preprocessing** | **str**| 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). | [optional]
**diagnostics** | **str**| Optional, diagnostics mode, default is 'false'. Possible values are 'true' (will set DiagnosticImage to a diagnostic PNG image in the result), and 'false' (no diagnostics are enabled; this is recommended for best performance). | [optional]

### Return type

Expand Down
1 change: 1 addition & 0 deletions docs/PhotoToWordsWithLocationResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**successful** | **bool** | | [optional]
**text_elements** | [**list[OcrPhotoTextElement]**](OcrPhotoTextElement.md) | Word elements in the image | [optional]
**diagnostic_image** | **str** | Typically null. To analyze OCR performance, enable diagnostic mode by adding the HTTP header \"DiagnosticMode\" with the value \"true\". When this is true, a diagnostic image showing the details of the OCR result will be set in PNG format into DiagnosticImage. | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
2 changes: 1 addition & 1 deletion packageconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"projectName" : "cloudmersive_ocr_api_client",
"packageName" : "cloudmersive_ocr_api_client",
"packageVersion": "2.0.3"
"packageVersion": "2.0.4"
}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from setuptools import setup, find_packages # noqa: H301

NAME = "cloudmersive_ocr_api_client"
VERSION = "2.0.3"
VERSION = "2.0.4"
# To install the library, run the following
#
# python setup.py install
Expand Down

0 comments on commit e69d25d

Please sign in to comment.