Skip to content

Commit 1540b5a

Browse files
authored
Release 24.4 (#73)
* Add ScanBarcode endpoint * Version 24.4.0
1 parent 2e7a133 commit 1540b5a

File tree

97 files changed

+216
-2236
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+216
-2236
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dist:
2222

2323
.PHONY: format
2424
format:
25-
python -m black --line-length=120 -v $(SRC) tests
25+
black --line-length=120 -v $(SRC) tests example.py
2626

2727
.PHONY: format_doc
2828
format_doc:

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![PyPI](https://img.shields.io/pypi/v/aspose-barcode-cloud)](https://pypi.org/project/aspose-barcode-cloud/)
66

77
- API version: 3.0
8-
- Package version: 24.3.0
8+
- Package version: 24.4.0
99

1010
## Demo applications
1111

@@ -119,6 +119,7 @@ Class | Method | HTTP request | Description
119119
*BarcodeApi* | [**put_barcode_generate_file**](docs/BarcodeApi.md#put_barcode_generate_file) | **PUT** /barcode/{name}/generate | Generate barcode and save on server (from query params or from file with json or xml content)
120120
*BarcodeApi* | [**put_barcode_recognize_from_body**](docs/BarcodeApi.md#put_barcode_recognize_from_body) | **PUT** /barcode/{name}/recognize | Recognition of a barcode from file on server with parameters in body.
121121
*BarcodeApi* | [**put_generate_multiple**](docs/BarcodeApi.md#put_generate_multiple) | **PUT** /barcode/{name}/generateMultiple | Generate image with multiple barcodes and put new file on server
122+
*BarcodeApi* | [**scan_barcode**](docs/BarcodeApi.md#scan_barcode) | **POST** /barcode/scan | Quickly scan a barcode from an image.
122123
*FileApi* | [**copy_file**](docs/FileApi.md#copy_file) | **PUT** /barcode/storage/file/copy/{srcPath} | Copy file
123124
*FileApi* | [**delete_file**](docs/FileApi.md#delete_file) | **DELETE** /barcode/storage/file/{path} | Delete file
124125
*FileApi* | [**download_file**](docs/FileApi.md#download_file) | **GET** /barcode/storage/file/{path} | Download file

aspose_barcode_cloud/__init__.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,6 @@
22

33
# flake8: noqa: F401
44

5-
"""
6-
7-
Copyright (c) 2024 Aspose.BarCode for Cloud
8-
9-
Permission is hereby granted, free of charge, to any person obtaining a copy
10-
of this software and associated documentation files (the "Software"), to deal
11-
in the Software without restriction, including without limitation the rights
12-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13-
copies of the Software, and to permit persons to whom the Software is
14-
furnished to do so, subject to the following conditions:
15-
16-
The above copyright notice and this permission notice shall be included in all
17-
copies or substantial portions of the Software.
18-
19-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25-
SOFTWARE.
26-
27-
"""
28-
29-
305
from __future__ import absolute_import
316

327
from aspose_barcode_cloud.rest import ApiException

aspose_barcode_cloud/api/barcode_api.py

Lines changed: 104 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,5 @@
11
# coding: utf-8
22

3-
"""
4-
5-
Copyright (c) 2024 Aspose.BarCode for Cloud
6-
7-
Permission is hereby granted, free of charge, to any person obtaining a copy
8-
of this software and associated documentation files (the "Software"), to deal
9-
in the Software without restriction, including without limitation the rights
10-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11-
copies of the Software, and to permit persons to whom the Software is
12-
furnished to do so, subject to the following conditions:
13-
14-
The above copyright notice and this permission notice shall be included in all
15-
copies or substantial portions of the Software.
16-
17-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23-
SOFTWARE.
24-
25-
"""
26-
273
from __future__ import absolute_import, division
284

295
import re # noqa: F401
@@ -489,7 +465,7 @@ def get_barcode_recognize(
489465
:param bool allow_additional_restorations: Allows engine using additional image restorations to recognize corrupted barcodes. At this time, it is used only in MicroPdf417 barcode type. Default value: False. # noqa: E501
490466
:param float region_likelihood_threshold_percent: Sets threshold for detected regions that may contain barcodes. Value 0.7 means that bottom 70% of possible regions are filtered out and not processed further. Region likelihood threshold must be between [0.05, 0.9] Use high values for clear images with few barcodes. Use low values for images with many barcodes or for noisy images. Low value may lead to a bigger recognition time. # noqa: E501
491467
:param list[int] scan_window_sizes: Scan window sizes in pixels. Allowed sizes are 10, 15, 20, 25, 30. Scanning with small window size takes more time and provides more accuracy but may fail in detecting very big barcodes. Combining of several window sizes can improve detection quality. # noqa: E501
492-
:param float similarity: Similarity coefficient depends on how homogeneous barcodes are. Use high value for for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] # noqa: E501
468+
:param float similarity: Similarity coefficient depends on how homogeneous barcodes are. Use high value for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] # noqa: E501
493469
:param bool skip_diagonal_search: Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. # noqa: E501
494470
:param bool read_tiny_barcodes: Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. # noqa: E501
495471
:param str australian_post_encoding_table: Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. # noqa: E501
@@ -865,7 +841,7 @@ def post_barcode_recognize_from_url_or_content(
865841
:param bool allow_additional_restorations: Allows engine using additional image restorations to recognize corrupted barcodes. At this time, it is used only in MicroPdf417 barcode type. Default value: False. # noqa: E501
866842
:param float region_likelihood_threshold_percent: Sets threshold for detected regions that may contain barcodes. Value 0.7 means that bottom 70% of possible regions are filtered out and not processed further. Region likelihood threshold must be between [0.05, 0.9] Use high values for clear images with few barcodes. Use low values for images with many barcodes or for noisy images. Low value may lead to a bigger recognition time. # noqa: E501
867843
:param list[int] scan_window_sizes: Scan window sizes in pixels. Allowed sizes are 10, 15, 20, 25, 30. Scanning with small window size takes more time and provides more accuracy but may fail in detecting very big barcodes. Combining of several window sizes can improve detection quality. # noqa: E501
868-
:param float similarity: Similarity coefficient depends on how homogeneous barcodes are. Use high value for for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] # noqa: E501
844+
:param float similarity: Similarity coefficient depends on how homogeneous barcodes are. Use high value for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] # noqa: E501
869845
:param bool skip_diagonal_search: Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. # noqa: E501
870846
:param bool read_tiny_barcodes: Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. # noqa: E501
871847
:param str australian_post_encoding_table: Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. # noqa: E501
@@ -1885,3 +1861,105 @@ def put_generate_multiple_with_http_info(self, name, generator_params_list, **kw
18851861
_request_timeout=params.get("_request_timeout"),
18861862
collection_formats=collection_formats,
18871863
)
1864+
1865+
def scan_barcode(self, image_file, decode_types=None, timeout=None, async_req=False, **kwargs):
1866+
"""Quickly scan a barcode from an image.
1867+
1868+
This method makes a synchronous HTTP request by default. To make an
1869+
asynchronous HTTP request, please pass async_req=True
1870+
>>> thread = BarcodeApi().scan_barcode(image_file, async_req=True)
1871+
>>> result = thread.get()
1872+
1873+
:param file image_file: Image as file # noqa: E501
1874+
:param list[DecodeBarcodeType] decode_types: Types of barcode to recognize # noqa: E501
1875+
: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
1876+
:param async_req bool
1877+
:return: BarcodeResponseList
1878+
If the method is called asynchronously,
1879+
returns the request thread.
1880+
"""
1881+
kwargs["_return_http_data_only"] = True
1882+
if async_req:
1883+
return self.scan_barcode_with_http_info(image_file, decode_types=decode_types, timeout=timeout, **kwargs)
1884+
else:
1885+
(data) = self.scan_barcode_with_http_info(image_file, decode_types=decode_types, timeout=timeout, **kwargs)
1886+
return data
1887+
1888+
def scan_barcode_with_http_info(self, image_file, **kwargs):
1889+
"""Quickly scan a barcode from an image.
1890+
1891+
This method makes a synchronous HTTP request by default. To make an
1892+
asynchronous HTTP request, please pass async_req=True
1893+
>>> thread = BarcodeApi().scan_barcode_with_http_info(image_file, async_req=True)
1894+
>>> result = thread.get()
1895+
1896+
:param file image_file: Image as file # noqa: E501
1897+
:return: BarcodeResponseList
1898+
If the method is called asynchronously,
1899+
returns the request thread.
1900+
"""
1901+
1902+
all_params = {"image_file", "decode_types", "timeout"}
1903+
all_params.add("async_req")
1904+
all_params.add("_return_http_data_only")
1905+
all_params.add("_preload_content")
1906+
all_params.add("_request_timeout")
1907+
1908+
params = locals()
1909+
for key, val in six.iteritems(params["kwargs"]):
1910+
if key not in all_params:
1911+
raise TypeError("Got an unexpected keyword argument '%s'" " to method scan_barcode" % key)
1912+
if val is None:
1913+
continue
1914+
1915+
params[key] = val
1916+
del params["kwargs"]
1917+
# verify the required parameter "image_file" is set
1918+
if "image_file" not in params or params["image_file"] is None:
1919+
raise ValueError("Missing the required parameter 'image_file' when calling 'scan_barcode'")
1920+
1921+
collection_formats = {}
1922+
1923+
path_params = {}
1924+
1925+
query_params = []
1926+
1927+
header_params = {}
1928+
1929+
form_params = []
1930+
local_var_files = {}
1931+
if "image_file" in params:
1932+
local_var_files["imageFile"] = params["image_file"]
1933+
if "decode_types" in params:
1934+
form_params.append(("decodeTypes", params["decode_types"]))
1935+
collection_formats["decodeTypes"] = "multi"
1936+
if "timeout" in params:
1937+
form_params.append(("timeout", params["timeout"]))
1938+
1939+
body_params = None
1940+
# HTTP header "Accept"
1941+
header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
1942+
1943+
# HTTP header "Content-Type"
1944+
header_params["Content-Type"] = self.api_client.select_header_content_type(["multipart/form-data"])
1945+
1946+
# Authentication setting
1947+
auth_settings = ["JWT"]
1948+
1949+
return self.api_client.call_api(
1950+
"/barcode/scan",
1951+
"POST",
1952+
path_params,
1953+
query_params,
1954+
header_params,
1955+
body=body_params,
1956+
post_params=form_params,
1957+
files=local_var_files,
1958+
response_type="BarcodeResponseList",
1959+
auth_settings=auth_settings,
1960+
async_req=params.get("async_req"),
1961+
_return_http_data_only=params.get("_return_http_data_only"),
1962+
_preload_content=params.get("_preload_content", True),
1963+
_request_timeout=params.get("_request_timeout"),
1964+
collection_formats=collection_formats,
1965+
)

aspose_barcode_cloud/api/file_api.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,5 @@
11
# coding: utf-8
22

3-
"""
4-
5-
Copyright (c) 2024 Aspose.BarCode for Cloud
6-
7-
Permission is hereby granted, free of charge, to any person obtaining a copy
8-
of this software and associated documentation files (the "Software"), to deal
9-
in the Software without restriction, including without limitation the rights
10-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11-
copies of the Software, and to permit persons to whom the Software is
12-
furnished to do so, subject to the following conditions:
13-
14-
The above copyright notice and this permission notice shall be included in all
15-
copies or substantial portions of the Software.
16-
17-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23-
SOFTWARE.
24-
25-
"""
26-
273
from __future__ import absolute_import, division
284

295
import re # noqa: F401

aspose_barcode_cloud/api/folder_api.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,5 @@
11
# coding: utf-8
22

3-
"""
4-
5-
Copyright (c) 2024 Aspose.BarCode for Cloud
6-
7-
Permission is hereby granted, free of charge, to any person obtaining a copy
8-
of this software and associated documentation files (the "Software"), to deal
9-
in the Software without restriction, including without limitation the rights
10-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11-
copies of the Software, and to permit persons to whom the Software is
12-
furnished to do so, subject to the following conditions:
13-
14-
The above copyright notice and this permission notice shall be included in all
15-
copies or substantial portions of the Software.
16-
17-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23-
SOFTWARE.
24-
25-
"""
26-
273
from __future__ import absolute_import, division
284

295
import re # noqa: F401

aspose_barcode_cloud/api/storage_api.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,5 @@
11
# coding: utf-8
22

3-
"""
4-
5-
Copyright (c) 2024 Aspose.BarCode for Cloud
6-
7-
Permission is hereby granted, free of charge, to any person obtaining a copy
8-
of this software and associated documentation files (the "Software"), to deal
9-
in the Software without restriction, including without limitation the rights
10-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11-
copies of the Software, and to permit persons to whom the Software is
12-
furnished to do so, subject to the following conditions:
13-
14-
The above copyright notice and this permission notice shall be included in all
15-
copies or substantial portions of the Software.
16-
17-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23-
SOFTWARE.
24-
25-
"""
26-
273
from __future__ import absolute_import, division
284

295
import re # noqa: F401

aspose_barcode_cloud/api_client.py

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,4 @@
11
# coding: utf-8
2-
"""
3-
4-
Copyright (c) 2024 Aspose.BarCode for Cloud
5-
6-
Permission is hereby granted, free of charge, to any person obtaining a copy
7-
of this software and associated documentation files (the "Software"), to deal
8-
in the Software without restriction, including without limitation the rights
9-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10-
copies of the Software, and to permit persons to whom the Software is
11-
furnished to do so, subject to the following conditions:
12-
13-
The above copyright notice and this permission notice shall be included in all
14-
copies or substantial portions of the Software.
15-
16-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22-
SOFTWARE.
23-
24-
"""
252

263
from __future__ import absolute_import, division
274

@@ -90,13 +67,13 @@ def __init__(self, configuration=None, header_name=None, header_value=None, cook
9067
self.rest_client = RESTClientObject(configuration)
9168
self.default_headers = {
9269
"x-aspose-client": "python sdk",
93-
"x-aspose-client-version": "24.3.0",
70+
"x-aspose-client-version": "24.4.0",
9471
}
9572
if header_name is not None:
9673
self.default_headers[header_name] = header_value
9774
self.cookie = cookie
9875
# Set default User-Agent.
99-
self.user_agent = "Aspose-Barcode-SDK/24.3.0/python"
76+
self.user_agent = "Aspose-Barcode-SDK/24.4.0/python"
10077

10178
def __del__(self):
10279
self.rest_client.close()

0 commit comments

Comments
 (0)