Skip to content

Commit

Permalink
Release 24.9 (#80)
Browse files Browse the repository at this point in the history
* Update documentation

* Add checksumValidation

* Add test for Code39 type without checksum

* Update version to 24.9.0
  • Loading branch information
Denis-Averin authored Sep 27, 2024
1 parent d7192b9 commit 76df3b8
Show file tree
Hide file tree
Showing 12 changed files with 99 additions and 80 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![PyPI](https://img.shields.io/pypi/v/aspose-barcode-cloud)](https://pypi.org/project/aspose-barcode-cloud/)

- API version: 3.0
- Package version: 24.8.0
- Package version: 24.9.0

## Demo applications

Expand Down
55 changes: 29 additions & 26 deletions aspose_barcode_cloud/api/barcode_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def get_barcode_generate(
text_location=None,
text_alignment=None,
text_color=None,
font_size_mode=None,
no_wrap=None,
resolution=None,
resolution_x=None,
Expand Down Expand Up @@ -71,8 +70,7 @@ def get_barcode_generate(
:param str two_d_display_text: Text that will be displayed instead of codetext in 2D barcodes. Used for: Aztec, Pdf417, DataMatrix, QR, MaxiCode, DotCode # noqa: E501
:param str text_location: Specify the displaying Text Location, set to CodeLocation.None to hide CodeText. Default value: CodeLocation.Below. # noqa: E501
:param str text_alignment: Text alignment. # noqa: E501
:param str text_color: Specify the displaying CodeText's Color. Default value: Color.Black. # noqa: E501
:param str font_size_mode: Specify FontSizeMode. If FontSizeMode is set to Auto, font size will be calculated automatically based on xDimension value. It is recommended to use FontSizeMode.Auto especially in AutoSizeMode.Nearest or AutoSizeMode.Interpolation. Default value: FontSizeMode.Auto. # noqa: E501
:param str text_color: Specify the displaying CodeText's Color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF # noqa: E501
:param bool no_wrap: Specify word wraps (line breaks) within text. Default value: false. # noqa: E501
:param float resolution: Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. # noqa: E501
:param float resolution_x: DEPRECATED: Use 'Resolution' instead. # noqa: E501
Expand All @@ -85,9 +83,9 @@ def get_barcode_generate(
:param float image_height: Height of the barcode image in given units. Default units: pixel. # noqa: E501
:param float image_width: Width of the barcode image in given units. Default units: pixel. # noqa: E501
:param float rotation_angle: BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. # noqa: E501
:param str back_color: Background color of the barcode image. Default value: Color.White. # noqa: E501
:param str bar_color: Bars color. Default value: Color.Black. # noqa: E501
:param str border_color: Border color. Default value: Color.Black. # noqa: E501
:param str back_color: Background color of the barcode image. Default value: white. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF # noqa: E501
:param str bar_color: Bars color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF # noqa: E501
:param str border_color: Border color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF # noqa: E501
:param float border_width: Border width. Default value: 0. Ignored if Visible is set to false. # noqa: E501
:param str border_dash_style: Border dash style. Default value: BorderDashStyle.Solid. # noqa: E501
:param bool border_visible: Border visibility. If false than parameter Width is always ignored (0). Default value: false. # noqa: E501
Expand Down Expand Up @@ -116,7 +114,6 @@ def get_barcode_generate(
text_location=text_location,
text_alignment=text_alignment,
text_color=text_color,
font_size_mode=font_size_mode,
no_wrap=no_wrap,
resolution=resolution,
resolution_x=resolution_x,
Expand Down Expand Up @@ -156,7 +153,6 @@ def get_barcode_generate(
text_location=text_location,
text_alignment=text_alignment,
text_color=text_color,
font_size_mode=font_size_mode,
no_wrap=no_wrap,
resolution=resolution,
resolution_x=resolution_x,
Expand Down Expand Up @@ -212,7 +208,6 @@ def get_barcode_generate_with_http_info(self, type, text, **kwargs):
"text_location",
"text_alignment",
"text_color",
"font_size_mode",
"no_wrap",
"resolution",
"resolution_x",
Expand Down Expand Up @@ -281,8 +276,6 @@ def get_barcode_generate_with_http_info(self, type, text, **kwargs):
query_params.append(("TextAlignment", params["text_alignment"]))
if "text_color" in params:
query_params.append(("TextColor", params["text_color"]))
if "font_size_mode" in params:
query_params.append(("FontSizeMode", params["font_size_mode"]))
if "no_wrap" in params:
query_params.append(("NoWrap", params["no_wrap"]))
if "resolution" in params:
Expand Down Expand Up @@ -1240,7 +1233,6 @@ def put_barcode_generate_file(
text_location=None,
text_alignment=None,
text_color=None,
font_size_mode=None,
no_wrap=None,
resolution=None,
resolution_x=None,
Expand Down Expand Up @@ -1288,8 +1280,7 @@ def put_barcode_generate_file(
:param str two_d_display_text: Text that will be displayed instead of codetext in 2D barcodes. Used for: Aztec, Pdf417, DataMatrix, QR, MaxiCode, DotCode # noqa: E501
:param str text_location: Specify the displaying Text Location, set to CodeLocation.None to hide CodeText. Default value: CodeLocation.Below. # noqa: E501
:param str text_alignment: Text alignment. # noqa: E501
:param str text_color: Specify the displaying CodeText's Color. Default value: Color.Black. # noqa: E501
:param str font_size_mode: Specify FontSizeMode. If FontSizeMode is set to Auto, font size will be calculated automatically based on xDimension value. It is recommended to use FontSizeMode.Auto especially in AutoSizeMode.Nearest or AutoSizeMode.Interpolation. Default value: FontSizeMode.Auto. # noqa: E501
:param str text_color: Specify the displaying CodeText's Color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF # noqa: E501
:param bool no_wrap: Specify word wraps (line breaks) within text. Default value: false. # noqa: E501
:param float resolution: Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. # noqa: E501
:param float resolution_x: DEPRECATED: Use 'Resolution' instead. # noqa: E501
Expand All @@ -1302,9 +1293,9 @@ def put_barcode_generate_file(
:param float image_height: Height of the barcode image in given units. Default units: pixel. # noqa: E501
:param float image_width: Width of the barcode image in given units. Default units: pixel. # noqa: E501
:param float rotation_angle: BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0. # noqa: E501
:param str back_color: Background color of the barcode image. Default value: Color.White. # noqa: E501
:param str bar_color: Bars color. Default value: Color.Black. # noqa: E501
:param str border_color: Border color. Default value: Color.Black. # noqa: E501
:param str back_color: Background color of the barcode image. Default value: white. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF # noqa: E501
:param str bar_color: Bars color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF # noqa: E501
:param str border_color: Border color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF # noqa: E501
:param float border_width: Border width. Default value: 0. Ignored if Visible is set to false. # noqa: E501
:param str border_dash_style: Border dash style. Default value: BorderDashStyle.Solid. # noqa: E501
:param bool border_visible: Border visibility. If false than parameter Width is always ignored (0). Default value: false. # noqa: E501
Expand Down Expand Up @@ -1336,7 +1327,6 @@ def put_barcode_generate_file(
text_location=text_location,
text_alignment=text_alignment,
text_color=text_color,
font_size_mode=font_size_mode,
no_wrap=no_wrap,
resolution=resolution,
resolution_x=resolution_x,
Expand Down Expand Up @@ -1379,7 +1369,6 @@ def put_barcode_generate_file(
text_location=text_location,
text_alignment=text_alignment,
text_color=text_color,
font_size_mode=font_size_mode,
no_wrap=no_wrap,
resolution=resolution,
resolution_x=resolution_x,
Expand Down Expand Up @@ -1439,7 +1428,6 @@ def put_barcode_generate_file_with_http_info(self, name, type, text, **kwargs):
"text_location",
"text_alignment",
"text_color",
"font_size_mode",
"no_wrap",
"resolution",
"resolution_x",
Expand Down Expand Up @@ -1515,8 +1503,6 @@ def put_barcode_generate_file_with_http_info(self, name, type, text, **kwargs):
query_params.append(("TextAlignment", params["text_alignment"]))
if "text_color" in params:
query_params.append(("TextColor", params["text_color"]))
if "font_size_mode" in params:
query_params.append(("FontSizeMode", params["font_size_mode"]))
if "no_wrap" in params:
query_params.append(("NoWrap", params["no_wrap"]))
if "resolution" in params:
Expand Down Expand Up @@ -1857,7 +1843,9 @@ def put_generate_multiple_with_http_info(self, name, generator_params_list, **kw
collection_formats=collection_formats,
)

def scan_barcode(self, image_file, decode_types=None, timeout=None, async_req=False, **kwargs):
def scan_barcode(
self, image_file, decode_types=None, timeout=None, checksum_validation=None, async_req=False, **kwargs
):
"""Quickly scan a barcode from an image.
This method makes a synchronous HTTP request by default. To make an
Expand All @@ -1868,16 +1856,29 @@ def scan_barcode(self, image_file, decode_types=None, timeout=None, async_req=Fa
:param file image_file: Image as file # noqa: E501
:param list[DecodeBarcodeType] decode_types: Types of barcode to recognize # noqa: E501
:param int timeout: Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). Maximum value is 30_000 (1/2 minute). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. # noqa: E501
:param str checksum_validation: Checksum validation setting. Default is ON. # noqa: E501
:param async_req bool
:return: BarcodeResponseList
If the method is called asynchronously,
returns the request thread.
"""
kwargs["_return_http_data_only"] = True
if async_req:
return self.scan_barcode_with_http_info(image_file, decode_types=decode_types, timeout=timeout, **kwargs)
return self.scan_barcode_with_http_info(
image_file,
decode_types=decode_types,
timeout=timeout,
checksum_validation=checksum_validation,
**kwargs
)
else:
(data) = self.scan_barcode_with_http_info(image_file, decode_types=decode_types, timeout=timeout, **kwargs)
(data) = self.scan_barcode_with_http_info(
image_file,
decode_types=decode_types,
timeout=timeout,
checksum_validation=checksum_validation,
**kwargs
)
return data

def scan_barcode_with_http_info(self, image_file, **kwargs):
Expand All @@ -1894,7 +1895,7 @@ def scan_barcode_with_http_info(self, image_file, **kwargs):
returns the request thread.
"""

all_params = {"image_file", "decode_types", "timeout"}
all_params = {"image_file", "decode_types", "timeout", "checksum_validation"}
all_params.add("async_req")
all_params.add("_return_http_data_only")
all_params.add("_preload_content")
Expand Down Expand Up @@ -1930,6 +1931,8 @@ def scan_barcode_with_http_info(self, image_file, **kwargs):
collection_formats["decodeTypes"] = "multi"
if "timeout" in params:
form_params.append(("timeout", params["timeout"]))
if "checksum_validation" in params:
form_params.append(("checksumValidation", params["checksum_validation"]))

body_params = None
# HTTP header "Accept"
Expand Down
4 changes: 2 additions & 2 deletions aspose_barcode_cloud/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ def __init__(self, configuration=None, header_name=None, header_value=None, cook
self.rest_client = RESTClientObject(configuration)
self.default_headers = {
"x-aspose-client": "python sdk",
"x-aspose-client-version": "24.8.0",
"x-aspose-client-version": "24.9.0",
}
if header_name is not None:
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = "Aspose-Barcode-SDK/24.8.0/python"
self.user_agent = "Aspose-Barcode-SDK/24.9.0/python"

def __del__(self):
self.rest_client.close()
Expand Down
2 changes: 1 addition & 1 deletion aspose_barcode_cloud/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def to_debug_report(self):
"OS: {env}\n"
"Python Version: {pyversion}\n"
"Version of the API: 3.0\n"
"SDK Package Version: 24.8.0".format(env=sys.platform, pyversion=sys.version)
"SDK Package Version: 24.9.0".format(env=sys.platform, pyversion=sys.version)
)

@staticmethod
Expand Down
4 changes: 2 additions & 2 deletions aspose_barcode_cloud/models/caption_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def alignment(self, alignment):
def color(self):
"""Gets the color of this CaptionParams. # noqa: E501
Text color. # noqa: E501
Text color. Default value: black Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF # noqa: E501
:return: The color of this CaptionParams. # noqa: E501
:rtype: str
Expand All @@ -128,7 +128,7 @@ def color(self):
def color(self, color):
"""Sets the color of this CaptionParams.
Text color. # noqa: E501
Text color. Default value: black Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF # noqa: E501
:param color: The color of this CaptionParams. # noqa: E501
:type: str
Expand Down
20 changes: 10 additions & 10 deletions aspose_barcode_cloud/models/generator_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ def text_alignment(self, text_alignment):
def text_color(self):
"""Gets the text_color of this GeneratorParams. # noqa: E501
Specify the displaying CodeText's Color. Default value: Color.Black. # noqa: E501
Specify the displaying CodeText's Color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF # noqa: E501
:return: The text_color of this GeneratorParams. # noqa: E501
:rtype: str
Expand All @@ -500,7 +500,7 @@ def text_color(self):
def text_color(self, text_color):
"""Sets the text_color of this GeneratorParams.
Specify the displaying CodeText's Color. Default value: Color.Black. # noqa: E501
Specify the displaying CodeText's Color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF # noqa: E501
:param text_color: The text_color of this GeneratorParams. # noqa: E501
:type: str
Expand Down Expand Up @@ -911,7 +911,7 @@ def caption_below(self, caption_below):
def back_color(self):
"""Gets the back_color of this GeneratorParams. # noqa: E501
Background color of the barcode image. Default value: Color.White. # noqa: E501
Background color of the barcode image. Default value: white. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF # noqa: E501
:return: The back_color of this GeneratorParams. # noqa: E501
:rtype: str
Expand All @@ -922,7 +922,7 @@ def back_color(self):
def back_color(self, back_color):
"""Sets the back_color of this GeneratorParams.
Background color of the barcode image. Default value: Color.White. # noqa: E501
Background color of the barcode image. Default value: white. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF # noqa: E501
:param back_color: The back_color of this GeneratorParams. # noqa: E501
:type: str
Expand All @@ -934,7 +934,7 @@ def back_color(self, back_color):
def bar_color(self):
"""Gets the bar_color of this GeneratorParams. # noqa: E501
Bars color. Default value: Color.Black. # noqa: E501
Bars color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF # noqa: E501
:return: The bar_color of this GeneratorParams. # noqa: E501
:rtype: str
Expand All @@ -945,7 +945,7 @@ def bar_color(self):
def bar_color(self, bar_color):
"""Sets the bar_color of this GeneratorParams.
Bars color. Default value: Color.Black. # noqa: E501
Bars color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF # noqa: E501
:param bar_color: The bar_color of this GeneratorParams. # noqa: E501
:type: str
Expand All @@ -957,7 +957,7 @@ def bar_color(self, bar_color):
def border_color(self):
"""Gets the border_color of this GeneratorParams. # noqa: E501
Border color. Default value: Color.Black. # noqa: E501
Border color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF # noqa: E501
:return: The border_color of this GeneratorParams. # noqa: E501
:rtype: str
Expand All @@ -968,7 +968,7 @@ def border_color(self):
def border_color(self, border_color):
"""Sets the border_color of this GeneratorParams.
Border color. Default value: Color.Black. # noqa: E501
Border color. Default value: black. Use named colors like: red, green, blue Or HTML colors like: #FF0000, #00FF00, #0000FF # noqa: E501
:param border_color: The border_color of this GeneratorParams. # noqa: E501
:type: str
Expand Down Expand Up @@ -1624,7 +1624,7 @@ def patch_code(self, patch_code):
def code128(self):
"""Gets the code128 of this GeneratorParams. # noqa: E501
Code128 params. # noqa: E501
Code128 parameters # noqa: E501
:return: The code128 of this GeneratorParams. # noqa: E501
:rtype: Code128Params
Expand All @@ -1635,7 +1635,7 @@ def code128(self):
def code128(self, code128):
"""Sets the code128 of this GeneratorParams.
Code128 params. # noqa: E501
Code128 parameters # noqa: E501
:param code128: The code128 of this GeneratorParams. # noqa: E501
:type: Code128Params
Expand Down
Loading

0 comments on commit 76df3b8

Please sign in to comment.