Skip to content

Commit

Permalink
2.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Cloudmersive committed Nov 18, 2019
1 parent 1a03630 commit e3173a3
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 18 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 provides a native API client for [Cloudmersive OCR](https://www.cloudmersive.com/ocr-api)

- API version: v1
- Package version: 2.1.5
- Package version: 2.1.6
- Build package: io.swagger.codegen.languages.PythonClientCodegen

## Requirements.
Expand Down
12 changes: 10 additions & 2 deletions cloudmersive_ocr_api_client/api/image_ocr_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ def image_ocr_photo_recognize_form(self, image_file, **kwargs): # noqa: E501
:param object form_template_definition: Form field definitions
:param str recognition_mode: Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled.
: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 - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement.
: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).
: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)
:return: FormRecognitionResult
If the method is called asynchronously,
Expand All @@ -386,13 +387,14 @@ def image_ocr_photo_recognize_form_with_http_info(self, image_file, **kwargs):
:param object form_template_definition: Form field definitions
:param str recognition_mode: Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled.
: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 - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement.
: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).
: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)
:return: FormRecognitionResult
If the method is called asynchronously,
returns the request thread.
"""

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

Expand Down Expand Up @@ -476,6 +480,7 @@ def image_ocr_photo_recognize_form_advanced(self, image_file, **kwargs): # noqa
:param str bucket_secret_key: Bucket Secret Key of the Configuration Bucket storing the form templates
:param str recognition_mode: Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled.
: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 - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement.
: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: FormRecognitionResult
If the method is called asynchronously,
returns the request thread.
Expand All @@ -502,12 +507,13 @@ def image_ocr_photo_recognize_form_advanced_with_http_info(self, image_file, **k
:param str bucket_secret_key: Bucket Secret Key of the Configuration Bucket storing the form templates
:param str recognition_mode: Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled.
: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 - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement.
: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: FormRecognitionResult
If the method is called asynchronously,
returns the request thread.
"""

all_params = ['image_file', 'bucket_id', 'bucket_secret_key', 'recognition_mode', 'preprocessing'] # noqa: E501
all_params = ['image_file', 'bucket_id', 'bucket_secret_key', 'recognition_mode', '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 @@ -542,6 +548,8 @@ def image_ocr_photo_recognize_form_advanced_with_http_info(self, image_file, **k
header_params['recognitionMode'] = params['recognition_mode'] # 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.1.5/python'
self.user_agent = 'Swagger-Codegen/2.1.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.1.5".\
"SDK Package Version: 2.1.6".\
format(env=sys.platform, pyversion=sys.version)
62 changes: 59 additions & 3 deletions cloudmersive_ocr_api_client/models/form_field_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class FormFieldDefinition(object):
'horizontal_alignment_type': 'str',
'target_field_width_relative': 'float',
'target_field_height_relative': 'float',
'target_field_horizontal_adjustment': 'float',
'target_field_vertical_adjustment': 'float',
'ignore': 'list[str]'
}

Expand All @@ -59,10 +61,12 @@ class FormFieldDefinition(object):
'horizontal_alignment_type': 'HorizontalAlignmentType',
'target_field_width_relative': 'TargetFieldWidth_Relative',
'target_field_height_relative': 'TargetFieldHeight_Relative',
'target_field_horizontal_adjustment': 'TargetFieldHorizontalAdjustment',
'target_field_vertical_adjustment': 'TargetFieldVerticalAdjustment',
'ignore': 'Ignore'
}

def __init__(self, field_id=None, left_anchor=None, top_anchor=None, anchor_mode=None, data_type=None, target_digit_count=None, minimum_character_count=None, allow_numeric_digits=None, vertical_alignment_type=None, horizontal_alignment_type=None, target_field_width_relative=None, target_field_height_relative=None, ignore=None): # noqa: E501
def __init__(self, field_id=None, left_anchor=None, top_anchor=None, anchor_mode=None, data_type=None, target_digit_count=None, minimum_character_count=None, allow_numeric_digits=None, vertical_alignment_type=None, horizontal_alignment_type=None, target_field_width_relative=None, target_field_height_relative=None, target_field_horizontal_adjustment=None, target_field_vertical_adjustment=None, ignore=None): # noqa: E501
"""FormFieldDefinition - a model defined in Swagger""" # noqa: E501

self._field_id = None
Expand All @@ -77,6 +81,8 @@ def __init__(self, field_id=None, left_anchor=None, top_anchor=None, anchor_mode
self._horizontal_alignment_type = None
self._target_field_width_relative = None
self._target_field_height_relative = None
self._target_field_horizontal_adjustment = None
self._target_field_vertical_adjustment = None
self._ignore = None
self.discriminator = None

Expand Down Expand Up @@ -104,6 +110,10 @@ def __init__(self, field_id=None, left_anchor=None, top_anchor=None, anchor_mode
self.target_field_width_relative = target_field_width_relative
if target_field_height_relative is not None:
self.target_field_height_relative = target_field_height_relative
if target_field_horizontal_adjustment is not None:
self.target_field_horizontal_adjustment = target_field_horizontal_adjustment
if target_field_vertical_adjustment is not None:
self.target_field_vertical_adjustment = target_field_vertical_adjustment
if ignore is not None:
self.ignore = ignore

Expand Down Expand Up @@ -180,7 +190,7 @@ def top_anchor(self, top_anchor):
def anchor_mode(self):
"""Gets the anchor_mode of this FormFieldDefinition. # noqa: E501
Optional - the matching mode for the anchor. Possible values are Complete (requires the entire anchor to match) and Partial (allows only part of the anchor to match). Default is Partial. # noqa: E501
Optional - the matching mode for the anchor. Possible values are Complete (requires the entire anchor to match) and Partial (allows only part of the anchor to match) and Horizontal (anchor must be laid out horizontally). Default is Partial. # noqa: E501
:return: The anchor_mode of this FormFieldDefinition. # noqa: E501
:rtype: str
Expand All @@ -191,7 +201,7 @@ def anchor_mode(self):
def anchor_mode(self, anchor_mode):
"""Sets the anchor_mode of this FormFieldDefinition.
Optional - the matching mode for the anchor. Possible values are Complete (requires the entire anchor to match) and Partial (allows only part of the anchor to match). Default is Partial. # noqa: E501
Optional - the matching mode for the anchor. Possible values are Complete (requires the entire anchor to match) and Partial (allows only part of the anchor to match) and Horizontal (anchor must be laid out horizontally). Default is Partial. # noqa: E501
:param anchor_mode: The anchor_mode of this FormFieldDefinition. # noqa: E501
:type: str
Expand Down Expand Up @@ -383,6 +393,52 @@ def target_field_height_relative(self, target_field_height_relative):

self._target_field_height_relative = target_field_height_relative

@property
def target_field_horizontal_adjustment(self):
"""Gets the target_field_horizontal_adjustment of this FormFieldDefinition. # noqa: E501
Optional - horizontal adjestment in relative width of the field # noqa: E501
:return: The target_field_horizontal_adjustment of this FormFieldDefinition. # noqa: E501
:rtype: float
"""
return self._target_field_horizontal_adjustment

@target_field_horizontal_adjustment.setter
def target_field_horizontal_adjustment(self, target_field_horizontal_adjustment):
"""Sets the target_field_horizontal_adjustment of this FormFieldDefinition.
Optional - horizontal adjestment in relative width of the field # noqa: E501
:param target_field_horizontal_adjustment: The target_field_horizontal_adjustment of this FormFieldDefinition. # noqa: E501
:type: float
"""

self._target_field_horizontal_adjustment = target_field_horizontal_adjustment

@property
def target_field_vertical_adjustment(self):
"""Gets the target_field_vertical_adjustment of this FormFieldDefinition. # noqa: E501
Optional - vertical adjestment in relative height of the field # noqa: E501
:return: The target_field_vertical_adjustment of this FormFieldDefinition. # noqa: E501
:rtype: float
"""
return self._target_field_vertical_adjustment

@target_field_vertical_adjustment.setter
def target_field_vertical_adjustment(self, target_field_vertical_adjustment):
"""Sets the target_field_vertical_adjustment of this FormFieldDefinition.
Optional - vertical adjestment in relative height of the field # noqa: E501
:param target_field_vertical_adjustment: The target_field_vertical_adjustment of this FormFieldDefinition. # noqa: E501
:type: float
"""

self._target_field_vertical_adjustment = target_field_vertical_adjustment

@property
def ignore(self):
"""Gets the ignore of this FormFieldDefinition. # noqa: E501
Expand Down
Loading

0 comments on commit e3173a3

Please sign in to comment.