aspose-barcode-cloud 25.12.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aspose_barcode_cloud-25.12.0/LICENSE +21 -0
- aspose_barcode_cloud-25.12.0/PKG-INFO +193 -0
- aspose_barcode_cloud-25.12.0/README.md +149 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/__init__.py +34 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/api/__init__.py +6 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/api/generate_api.py +533 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/api/recognize_api.py +352 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/api/scan_api.py +296 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/api_client.py +690 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/api_response.py +20 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/configuration.py +282 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/exceptions.py +210 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/models/__init__.py +23 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/models/api_error.py +215 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/models/api_error_response.py +125 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/models/barcode_image_format.py +80 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/models/barcode_image_params.py +340 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/models/barcode_response.py +177 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/models/barcode_response_list.py +100 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/models/code_location.py +78 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/models/decode_barcode_type.py +159 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/models/encode_barcode_type.py +148 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/models/encode_data.py +126 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/models/encode_data_type.py +78 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/models/generate_params.py +155 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/models/graphics_unit.py +79 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/models/recognition_image_kind.py +78 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/models/recognition_mode.py +78 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/models/recognize_base64_request.py +195 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/models/region_point.py +125 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/models/scan_base64_request.py +104 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/py.typed +0 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud/rest.py +376 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud.egg-info/PKG-INFO +193 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud.egg-info/SOURCES.txt +47 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud.egg-info/dependency_links.txt +1 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud.egg-info/requires.txt +3 -0
- aspose_barcode_cloud-25.12.0/aspose_barcode_cloud.egg-info/top_level.txt +1 -0
- aspose_barcode_cloud-25.12.0/setup.cfg +4 -0
- aspose_barcode_cloud-25.12.0/setup.py +173 -0
- aspose_barcode_cloud-25.12.0/tests/test_auth.py +58 -0
- aspose_barcode_cloud-25.12.0/tests/test_configuration.py +9 -0
- aspose_barcode_cloud-25.12.0/tests/test_exception.py +41 -0
- aspose_barcode_cloud-25.12.0/tests/test_generate_and_recognize.py +47 -0
- aspose_barcode_cloud-25.12.0/tests/test_generate_api.py +69 -0
- aspose_barcode_cloud-25.12.0/tests/test_headers.py +44 -0
- aspose_barcode_cloud-25.12.0/tests/test_load_configuration.py +24 -0
- aspose_barcode_cloud-25.12.0/tests/test_recognize_api.py +90 -0
- aspose_barcode_cloud-25.12.0/tests/test_scan_api.py +68 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Aspose Pty Ltd
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: aspose-barcode-cloud
|
|
3
|
+
Version: 25.12.0
|
|
4
|
+
Summary: Aspose.BarCode.Cloud v4.0 Specification
|
|
5
|
+
Home-page: https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-python
|
|
6
|
+
Author: Aspose Barcode Cloud
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Source With Tests, https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-python
|
|
9
|
+
Project-URL: Website, https://www.aspose.cloud
|
|
10
|
+
Project-URL: Product Home, https://products.aspose.cloud/barcode/
|
|
11
|
+
Project-URL: Documentation, https://docs.aspose.cloud/barcode/
|
|
12
|
+
Project-URL: Free Support Forum, https://forum.aspose.cloud/c/barcode
|
|
13
|
+
Project-URL: Paid Support Helpdesk, https://helpdesk.aspose.cloud/
|
|
14
|
+
Project-URL: Blog, https://blog.aspose.cloud/categories/aspose.barcode-cloud-product-family/
|
|
15
|
+
Keywords: Barcode-Scan,QR,DataMatrix,Barcode,AustraliaPost,VIN,MSI,Aztec,ISBN,OPC,Postnet,2D-Barcode,EAN13,ISSN,PZN,SingaporePost,Symbology,UPCA,UPCE,1D-Barcode,Code11,Code128,Code32,Codetext,DotCode,EAN14,EAN8,GS1DataMatrix,Interleaved2of5,ISMN,MaxiCode,OneCode,Pdf417,Pharmacode,Postal-Barcode,RM4SCC,SCC14,SSCC18,Code39Standard,GS1QR,MacroPdf417,JPEG,TIFF,PNG,BMP,GIF,EXIF,EMF,SVG,Aspose.BarCode,Aspose.BarCode-Cloud,Aspose.Total-Cloud,Cloud,REST,API,Generate-Barcode,Barcode-Generation,Barcode-Formatting,Format-Barcode,Barcode-Recognition,Recognize-Barcode,CodablockF,Checksum,Optimize-Barcode,Barcode-Optimization,cURL,.NET,C#,dotnet,CSharp,Java,PHP,Python,Node.js,Golang,Scan-Barcode,barcode,generation,recognition,Alpha-Numeric,AI-8102-Coupon,AustralianPosteParcel,Codabar,Code16K,Code39Extended,Code93Extended,Code93Standard,DatabarExpanded,DatabarExpandedStacked,DatabarLimited,DatabarOmniDirectional,DatabarStacked,DatabarStackedOmniDirectional,DatabarTruncated,DataLogic2of5,DeutschePostIdentcode,DeutschePostLeitcode,DutchKIX,GS1CodablockF,GS1Code128,IATA2of5,ItalianPost25,ITF14,ITF6,Matrix2of5,MicroPdf417,MICR,PatchCode,Planet,Standard2of5,SwissPostParcel,UpcaGs1Code128Coupon,UpcaGs1DatabarCoupon
|
|
16
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: Topic :: Software Development
|
|
19
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
20
|
+
Classifier: Operating System :: OS Independent
|
|
21
|
+
Classifier: Programming Language :: Python :: 3
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Requires-Dist: certifi>=2024.7.4
|
|
31
|
+
Requires-Dist: python-dateutil>=2.1
|
|
32
|
+
Requires-Dist: urllib3<3.0,>=2.5.0
|
|
33
|
+
Dynamic: author
|
|
34
|
+
Dynamic: classifier
|
|
35
|
+
Dynamic: description
|
|
36
|
+
Dynamic: description-content-type
|
|
37
|
+
Dynamic: home-page
|
|
38
|
+
Dynamic: keywords
|
|
39
|
+
Dynamic: license
|
|
40
|
+
Dynamic: license-file
|
|
41
|
+
Dynamic: project-url
|
|
42
|
+
Dynamic: requires-dist
|
|
43
|
+
Dynamic: summary
|
|
44
|
+
|
|
45
|
+
# Aspose.BarCode Cloud SDK for Python
|
|
46
|
+
|
|
47
|
+
[](LICENSE)
|
|
48
|
+
[](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-python/actions/workflows/python-package.yml)
|
|
49
|
+
[](https://pypi.org/project/aspose-barcode-cloud/)
|
|
50
|
+
|
|
51
|
+
- API version: 4.0
|
|
52
|
+
- Package version: 25.12.0
|
|
53
|
+
|
|
54
|
+
## SDK and API Version Compatibility:
|
|
55
|
+
|
|
56
|
+
- SDK Version 25.1 and Later: Starting from SDK version 25.1, all subsequent versions are compatible with API Version v4.0.
|
|
57
|
+
- SDK Version 24.12 and Earlier: These versions are compatible with API Version v3.0.
|
|
58
|
+
|
|
59
|
+
## Demo applications
|
|
60
|
+
|
|
61
|
+
[Scan QR](https://products.aspose.app/barcode/scanqr) | [Generate Barcode](https://products.aspose.app/barcode/generate) | [Recognize Barcode](https://products.aspose.app/barcode/recognize)
|
|
62
|
+
:---: | :---: | :---:
|
|
63
|
+
[](https://products.aspose.app/barcode/scanqr) | [](https://products.aspose.app/barcode/generate) | [](https://products.aspose.app/barcode/recognize)
|
|
64
|
+
[**Generate Wi-Fi QR**](https://products.aspose.app/barcode/wifi-qr) | [**Embed Barcode**](https://products.aspose.app/barcode/embed) | [**Scan Barcode**](https://products.aspose.app/barcode/scan)
|
|
65
|
+
[](https://products.aspose.app/barcode/wifi-qr) | [](https://products.aspose.app/barcode/embed) | [](https://products.aspose.app/barcode/scan)
|
|
66
|
+
|
|
67
|
+
[Aspose.BarCode for Cloud](https://products.aspose.cloud/barcode/) is a REST API for Linear, 2D and postal barcode generation and recognition in the cloud. API recognizes and generates barcode images in a variety of formats. Barcode REST API allows to specify barcode image attributes like image width, height, border style and output image format in order to customize the generation process. Developers can also specify the barcode type and text attributes such as text location and font styles in order to suit the application requirements.
|
|
68
|
+
|
|
69
|
+
This repository contains Aspose.BarCode Cloud SDK for Python source code. This SDK allows you to work with Aspose.BarCode for Cloud REST APIs in your Python 3 applications quickly and easily.
|
|
70
|
+
|
|
71
|
+
Supported Python versions:
|
|
72
|
+
|
|
73
|
+
- Python 3.9+
|
|
74
|
+
|
|
75
|
+
To use these SDKs, you will need Client Id and Client Secret which can be looked up at [Aspose Cloud Dashboard](https://dashboard.aspose.cloud/applications) (free registration in Aspose Cloud is required for this).
|
|
76
|
+
|
|
77
|
+
## How to use the SDK
|
|
78
|
+
|
|
79
|
+
The complete source code is available in this repository folder. You can either directly use it in your project via source code or get [from PyPi](https://pypi.org/project/aspose-barcode-cloud/) (recommended).
|
|
80
|
+
|
|
81
|
+
## Prerequisites
|
|
82
|
+
|
|
83
|
+
To use Aspose.BarCode Cloud SDK for Python you need to register an account with [Aspose Cloud](https://www.aspose.cloud) and lookup/create Client Secret and Client Id at [Cloud Dashboard](https://dashboard.aspose.cloud/applications). There is free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/).
|
|
84
|
+
|
|
85
|
+
## Installation
|
|
86
|
+
|
|
87
|
+
### Install aspose-barcode-cloud via pip
|
|
88
|
+
|
|
89
|
+
From the command line:
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
pip install aspose-barcode-cloud
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Then import the package:
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
import aspose_barcode_cloud
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Sample usage
|
|
102
|
+
|
|
103
|
+
The examples below show how you can generate and recognize Code128 barcode and save it into local file using aspose-barcode-cloud:
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
import os
|
|
107
|
+
from pprint import pprint
|
|
108
|
+
|
|
109
|
+
from aspose_barcode_cloud import (
|
|
110
|
+
GenerateApi,
|
|
111
|
+
RecognizeApi,
|
|
112
|
+
ApiClient,
|
|
113
|
+
Configuration,
|
|
114
|
+
EncodeBarcodeType,
|
|
115
|
+
CodeLocation,
|
|
116
|
+
DecodeBarcodeType,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
config = Configuration(
|
|
120
|
+
client_id="Client Id from https://dashboard.aspose.cloud/applications",
|
|
121
|
+
client_secret="Client Secret from https://dashboard.aspose.cloud/applications",
|
|
122
|
+
access_token=os.environ.get("TEST_CONFIGURATION_ACCESS_TOKEN"), # Only for testing in CI, remove this line
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
# Generate barcode
|
|
126
|
+
generateApi = GenerateApi(ApiClient(config))
|
|
127
|
+
response = generateApi.generate(EncodeBarcodeType.QR, "Example", text_location=CodeLocation.NONE)
|
|
128
|
+
with open("example.png", "wb") as f:
|
|
129
|
+
f.write(response.data)
|
|
130
|
+
print("Barcode saved to file 'example.png'")
|
|
131
|
+
|
|
132
|
+
# Recognize barcode
|
|
133
|
+
recognizeApi = RecognizeApi(ApiClient(config))
|
|
134
|
+
response = recognizeApi.recognize_multipart(DecodeBarcodeType.QR, open("example.png", "rb"))
|
|
135
|
+
pprint(response)
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Requirements
|
|
140
|
+
|
|
141
|
+
- urllib3 >= 1.21.1, <2.0
|
|
142
|
+
|
|
143
|
+
## Licensing
|
|
144
|
+
|
|
145
|
+
All Aspose.BarCode for Cloud SDKs, helper scripts and templates are licensed under [MIT License](LICENSE).
|
|
146
|
+
|
|
147
|
+
## Resources
|
|
148
|
+
|
|
149
|
+
- [**Website**](https://www.aspose.cloud)
|
|
150
|
+
- [**Product Home**](https://products.aspose.cloud/barcode/)
|
|
151
|
+
- [**Documentation**](https://docs.aspose.cloud/barcode/)
|
|
152
|
+
- [**Free Support Forum**](https://forum.aspose.cloud/c/barcode)
|
|
153
|
+
- [**Paid Support Helpdesk**](https://helpdesk.aspose.cloud/)
|
|
154
|
+
- [**Blog**](https://blog.aspose.cloud/categories/aspose.barcode-cloud-product-family/)
|
|
155
|
+
|
|
156
|
+
## Documentation for API Endpoints
|
|
157
|
+
|
|
158
|
+
All URIs are relative to *<https://api.aspose.cloud/v4.0>*
|
|
159
|
+
|
|
160
|
+
Class | Method | HTTP request | Description
|
|
161
|
+
----- | ------ | ------------ | -----------
|
|
162
|
+
*GenerateApi* | [**generate**](docs/GenerateApi.md#generate) | **GET** /barcode/generate/{barcodeType} | Generate barcode using GET request with parameters in route and query string.
|
|
163
|
+
*GenerateApi* | [**generate_body**](docs/GenerateApi.md#generate_body) | **POST** /barcode/generate-body | Generate barcode using POST request with parameters in body in json or xml format.
|
|
164
|
+
*GenerateApi* | [**generate_multipart**](docs/GenerateApi.md#generate_multipart) | **POST** /barcode/generate-multipart | Generate barcode using POST request with parameters in multipart form.
|
|
165
|
+
*RecognizeApi* | [**recognize**](docs/RecognizeApi.md#recognize) | **GET** /barcode/recognize | Recognize barcode from file on server in the Internet using GET requests with parameter in query string. For recognizing files from your hard drive use `recognize-body` or `recognize-multipart` endpoints instead.
|
|
166
|
+
*RecognizeApi* | [**recognize_base64**](docs/RecognizeApi.md#recognize_base64) | **POST** /barcode/recognize-body | Recognize barcode from file in request body using POST requests with parameters in body in json or xml format.
|
|
167
|
+
*RecognizeApi* | [**recognize_multipart**](docs/RecognizeApi.md#recognize_multipart) | **POST** /barcode/recognize-multipart | Recognize barcode from file in request body using POST requests with parameters in multipart form.
|
|
168
|
+
*ScanApi* | [**scan**](docs/ScanApi.md#scan) | **GET** /barcode/scan | Scan barcode from file on server in the Internet using GET requests with parameter in query string. For scaning files from your hard drive use `scan-body` or `scan-multipart` endpoints instead.
|
|
169
|
+
*ScanApi* | [**scan_base64**](docs/ScanApi.md#scan_base64) | **POST** /barcode/scan-body | Scan barcode from file in request body using POST requests with parameter in body in json or xml format.
|
|
170
|
+
*ScanApi* | [**scan_multipart**](docs/ScanApi.md#scan_multipart) | **POST** /barcode/scan-multipart | Scan barcode from file in request body using POST requests with parameter in multipart form.
|
|
171
|
+
|
|
172
|
+
## Documentation For Models
|
|
173
|
+
|
|
174
|
+
- [ApiError](docs/ApiError.md)
|
|
175
|
+
- [ApiErrorResponse](docs/ApiErrorResponse.md)
|
|
176
|
+
- [BarcodeImageFormat](docs/BarcodeImageFormat.md)
|
|
177
|
+
- [BarcodeImageParams](docs/BarcodeImageParams.md)
|
|
178
|
+
- [BarcodeResponse](docs/BarcodeResponse.md)
|
|
179
|
+
- [BarcodeResponseList](docs/BarcodeResponseList.md)
|
|
180
|
+
- [CodeLocation](docs/CodeLocation.md)
|
|
181
|
+
- [DecodeBarcodeType](docs/DecodeBarcodeType.md)
|
|
182
|
+
- [EncodeBarcodeType](docs/EncodeBarcodeType.md)
|
|
183
|
+
- [EncodeData](docs/EncodeData.md)
|
|
184
|
+
- [EncodeDataType](docs/EncodeDataType.md)
|
|
185
|
+
- [GenerateParams](docs/GenerateParams.md)
|
|
186
|
+
- [GraphicsUnit](docs/GraphicsUnit.md)
|
|
187
|
+
- [RecognitionImageKind](docs/RecognitionImageKind.md)
|
|
188
|
+
- [RecognitionMode](docs/RecognitionMode.md)
|
|
189
|
+
- [RecognizeBase64Request](docs/RecognizeBase64Request.md)
|
|
190
|
+
- [RegionPoint](docs/RegionPoint.md)
|
|
191
|
+
- [ScanBase64Request](docs/ScanBase64Request.md)
|
|
192
|
+
|
|
193
|
+
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# Aspose.BarCode Cloud SDK for Python
|
|
2
|
+
|
|
3
|
+
[](LICENSE)
|
|
4
|
+
[](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-python/actions/workflows/python-package.yml)
|
|
5
|
+
[](https://pypi.org/project/aspose-barcode-cloud/)
|
|
6
|
+
|
|
7
|
+
- API version: 4.0
|
|
8
|
+
- Package version: 25.12.0
|
|
9
|
+
|
|
10
|
+
## SDK and API Version Compatibility:
|
|
11
|
+
|
|
12
|
+
- SDK Version 25.1 and Later: Starting from SDK version 25.1, all subsequent versions are compatible with API Version v4.0.
|
|
13
|
+
- SDK Version 24.12 and Earlier: These versions are compatible with API Version v3.0.
|
|
14
|
+
|
|
15
|
+
## Demo applications
|
|
16
|
+
|
|
17
|
+
[Scan QR](https://products.aspose.app/barcode/scanqr) | [Generate Barcode](https://products.aspose.app/barcode/generate) | [Recognize Barcode](https://products.aspose.app/barcode/recognize)
|
|
18
|
+
:---: | :---: | :---:
|
|
19
|
+
[](https://products.aspose.app/barcode/scanqr) | [](https://products.aspose.app/barcode/generate) | [](https://products.aspose.app/barcode/recognize)
|
|
20
|
+
[**Generate Wi-Fi QR**](https://products.aspose.app/barcode/wifi-qr) | [**Embed Barcode**](https://products.aspose.app/barcode/embed) | [**Scan Barcode**](https://products.aspose.app/barcode/scan)
|
|
21
|
+
[](https://products.aspose.app/barcode/wifi-qr) | [](https://products.aspose.app/barcode/embed) | [](https://products.aspose.app/barcode/scan)
|
|
22
|
+
|
|
23
|
+
[Aspose.BarCode for Cloud](https://products.aspose.cloud/barcode/) is a REST API for Linear, 2D and postal barcode generation and recognition in the cloud. API recognizes and generates barcode images in a variety of formats. Barcode REST API allows to specify barcode image attributes like image width, height, border style and output image format in order to customize the generation process. Developers can also specify the barcode type and text attributes such as text location and font styles in order to suit the application requirements.
|
|
24
|
+
|
|
25
|
+
This repository contains Aspose.BarCode Cloud SDK for Python source code. This SDK allows you to work with Aspose.BarCode for Cloud REST APIs in your Python 3 applications quickly and easily.
|
|
26
|
+
|
|
27
|
+
Supported Python versions:
|
|
28
|
+
|
|
29
|
+
- Python 3.9+
|
|
30
|
+
|
|
31
|
+
To use these SDKs, you will need Client Id and Client Secret which can be looked up at [Aspose Cloud Dashboard](https://dashboard.aspose.cloud/applications) (free registration in Aspose Cloud is required for this).
|
|
32
|
+
|
|
33
|
+
## How to use the SDK
|
|
34
|
+
|
|
35
|
+
The complete source code is available in this repository folder. You can either directly use it in your project via source code or get [from PyPi](https://pypi.org/project/aspose-barcode-cloud/) (recommended).
|
|
36
|
+
|
|
37
|
+
## Prerequisites
|
|
38
|
+
|
|
39
|
+
To use Aspose.BarCode Cloud SDK for Python you need to register an account with [Aspose Cloud](https://www.aspose.cloud) and lookup/create Client Secret and Client Id at [Cloud Dashboard](https://dashboard.aspose.cloud/applications). There is free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/).
|
|
40
|
+
|
|
41
|
+
## Installation
|
|
42
|
+
|
|
43
|
+
### Install aspose-barcode-cloud via pip
|
|
44
|
+
|
|
45
|
+
From the command line:
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
pip install aspose-barcode-cloud
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Then import the package:
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
import aspose_barcode_cloud
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Sample usage
|
|
58
|
+
|
|
59
|
+
The examples below show how you can generate and recognize Code128 barcode and save it into local file using aspose-barcode-cloud:
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
import os
|
|
63
|
+
from pprint import pprint
|
|
64
|
+
|
|
65
|
+
from aspose_barcode_cloud import (
|
|
66
|
+
GenerateApi,
|
|
67
|
+
RecognizeApi,
|
|
68
|
+
ApiClient,
|
|
69
|
+
Configuration,
|
|
70
|
+
EncodeBarcodeType,
|
|
71
|
+
CodeLocation,
|
|
72
|
+
DecodeBarcodeType,
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
config = Configuration(
|
|
76
|
+
client_id="Client Id from https://dashboard.aspose.cloud/applications",
|
|
77
|
+
client_secret="Client Secret from https://dashboard.aspose.cloud/applications",
|
|
78
|
+
access_token=os.environ.get("TEST_CONFIGURATION_ACCESS_TOKEN"), # Only for testing in CI, remove this line
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
# Generate barcode
|
|
82
|
+
generateApi = GenerateApi(ApiClient(config))
|
|
83
|
+
response = generateApi.generate(EncodeBarcodeType.QR, "Example", text_location=CodeLocation.NONE)
|
|
84
|
+
with open("example.png", "wb") as f:
|
|
85
|
+
f.write(response.data)
|
|
86
|
+
print("Barcode saved to file 'example.png'")
|
|
87
|
+
|
|
88
|
+
# Recognize barcode
|
|
89
|
+
recognizeApi = RecognizeApi(ApiClient(config))
|
|
90
|
+
response = recognizeApi.recognize_multipart(DecodeBarcodeType.QR, open("example.png", "rb"))
|
|
91
|
+
pprint(response)
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Requirements
|
|
96
|
+
|
|
97
|
+
- urllib3 >= 1.21.1, <2.0
|
|
98
|
+
|
|
99
|
+
## Licensing
|
|
100
|
+
|
|
101
|
+
All Aspose.BarCode for Cloud SDKs, helper scripts and templates are licensed under [MIT License](LICENSE).
|
|
102
|
+
|
|
103
|
+
## Resources
|
|
104
|
+
|
|
105
|
+
- [**Website**](https://www.aspose.cloud)
|
|
106
|
+
- [**Product Home**](https://products.aspose.cloud/barcode/)
|
|
107
|
+
- [**Documentation**](https://docs.aspose.cloud/barcode/)
|
|
108
|
+
- [**Free Support Forum**](https://forum.aspose.cloud/c/barcode)
|
|
109
|
+
- [**Paid Support Helpdesk**](https://helpdesk.aspose.cloud/)
|
|
110
|
+
- [**Blog**](https://blog.aspose.cloud/categories/aspose.barcode-cloud-product-family/)
|
|
111
|
+
|
|
112
|
+
## Documentation for API Endpoints
|
|
113
|
+
|
|
114
|
+
All URIs are relative to *<https://api.aspose.cloud/v4.0>*
|
|
115
|
+
|
|
116
|
+
Class | Method | HTTP request | Description
|
|
117
|
+
----- | ------ | ------------ | -----------
|
|
118
|
+
*GenerateApi* | [**generate**](docs/GenerateApi.md#generate) | **GET** /barcode/generate/{barcodeType} | Generate barcode using GET request with parameters in route and query string.
|
|
119
|
+
*GenerateApi* | [**generate_body**](docs/GenerateApi.md#generate_body) | **POST** /barcode/generate-body | Generate barcode using POST request with parameters in body in json or xml format.
|
|
120
|
+
*GenerateApi* | [**generate_multipart**](docs/GenerateApi.md#generate_multipart) | **POST** /barcode/generate-multipart | Generate barcode using POST request with parameters in multipart form.
|
|
121
|
+
*RecognizeApi* | [**recognize**](docs/RecognizeApi.md#recognize) | **GET** /barcode/recognize | Recognize barcode from file on server in the Internet using GET requests with parameter in query string. For recognizing files from your hard drive use `recognize-body` or `recognize-multipart` endpoints instead.
|
|
122
|
+
*RecognizeApi* | [**recognize_base64**](docs/RecognizeApi.md#recognize_base64) | **POST** /barcode/recognize-body | Recognize barcode from file in request body using POST requests with parameters in body in json or xml format.
|
|
123
|
+
*RecognizeApi* | [**recognize_multipart**](docs/RecognizeApi.md#recognize_multipart) | **POST** /barcode/recognize-multipart | Recognize barcode from file in request body using POST requests with parameters in multipart form.
|
|
124
|
+
*ScanApi* | [**scan**](docs/ScanApi.md#scan) | **GET** /barcode/scan | Scan barcode from file on server in the Internet using GET requests with parameter in query string. For scaning files from your hard drive use `scan-body` or `scan-multipart` endpoints instead.
|
|
125
|
+
*ScanApi* | [**scan_base64**](docs/ScanApi.md#scan_base64) | **POST** /barcode/scan-body | Scan barcode from file in request body using POST requests with parameter in body in json or xml format.
|
|
126
|
+
*ScanApi* | [**scan_multipart**](docs/ScanApi.md#scan_multipart) | **POST** /barcode/scan-multipart | Scan barcode from file in request body using POST requests with parameter in multipart form.
|
|
127
|
+
|
|
128
|
+
## Documentation For Models
|
|
129
|
+
|
|
130
|
+
- [ApiError](docs/ApiError.md)
|
|
131
|
+
- [ApiErrorResponse](docs/ApiErrorResponse.md)
|
|
132
|
+
- [BarcodeImageFormat](docs/BarcodeImageFormat.md)
|
|
133
|
+
- [BarcodeImageParams](docs/BarcodeImageParams.md)
|
|
134
|
+
- [BarcodeResponse](docs/BarcodeResponse.md)
|
|
135
|
+
- [BarcodeResponseList](docs/BarcodeResponseList.md)
|
|
136
|
+
- [CodeLocation](docs/CodeLocation.md)
|
|
137
|
+
- [DecodeBarcodeType](docs/DecodeBarcodeType.md)
|
|
138
|
+
- [EncodeBarcodeType](docs/EncodeBarcodeType.md)
|
|
139
|
+
- [EncodeData](docs/EncodeData.md)
|
|
140
|
+
- [EncodeDataType](docs/EncodeDataType.md)
|
|
141
|
+
- [GenerateParams](docs/GenerateParams.md)
|
|
142
|
+
- [GraphicsUnit](docs/GraphicsUnit.md)
|
|
143
|
+
- [RecognitionImageKind](docs/RecognitionImageKind.md)
|
|
144
|
+
- [RecognitionMode](docs/RecognitionMode.md)
|
|
145
|
+
- [RecognizeBase64Request](docs/RecognizeBase64Request.md)
|
|
146
|
+
- [RegionPoint](docs/RegionPoint.md)
|
|
147
|
+
- [ScanBase64Request](docs/ScanBase64Request.md)
|
|
148
|
+
|
|
149
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa: F401
|
|
4
|
+
|
|
5
|
+
from aspose_barcode_cloud.rest import ApiException
|
|
6
|
+
|
|
7
|
+
# import apis into sdk package
|
|
8
|
+
from aspose_barcode_cloud.api.generate_api import GenerateApi
|
|
9
|
+
from aspose_barcode_cloud.api.recognize_api import RecognizeApi
|
|
10
|
+
from aspose_barcode_cloud.api.scan_api import ScanApi
|
|
11
|
+
|
|
12
|
+
# import ApiClient
|
|
13
|
+
from aspose_barcode_cloud.api_client import ApiClient
|
|
14
|
+
from aspose_barcode_cloud.configuration import Configuration
|
|
15
|
+
|
|
16
|
+
# import models into sdk package
|
|
17
|
+
from aspose_barcode_cloud.models.api_error import ApiError
|
|
18
|
+
from aspose_barcode_cloud.models.api_error_response import ApiErrorResponse
|
|
19
|
+
from aspose_barcode_cloud.models.barcode_image_format import BarcodeImageFormat
|
|
20
|
+
from aspose_barcode_cloud.models.barcode_image_params import BarcodeImageParams
|
|
21
|
+
from aspose_barcode_cloud.models.barcode_response import BarcodeResponse
|
|
22
|
+
from aspose_barcode_cloud.models.barcode_response_list import BarcodeResponseList
|
|
23
|
+
from aspose_barcode_cloud.models.code_location import CodeLocation
|
|
24
|
+
from aspose_barcode_cloud.models.decode_barcode_type import DecodeBarcodeType
|
|
25
|
+
from aspose_barcode_cloud.models.encode_barcode_type import EncodeBarcodeType
|
|
26
|
+
from aspose_barcode_cloud.models.encode_data import EncodeData
|
|
27
|
+
from aspose_barcode_cloud.models.encode_data_type import EncodeDataType
|
|
28
|
+
from aspose_barcode_cloud.models.generate_params import GenerateParams
|
|
29
|
+
from aspose_barcode_cloud.models.graphics_unit import GraphicsUnit
|
|
30
|
+
from aspose_barcode_cloud.models.recognition_image_kind import RecognitionImageKind
|
|
31
|
+
from aspose_barcode_cloud.models.recognition_mode import RecognitionMode
|
|
32
|
+
from aspose_barcode_cloud.models.recognize_base64_request import RecognizeBase64Request
|
|
33
|
+
from aspose_barcode_cloud.models.region_point import RegionPoint
|
|
34
|
+
from aspose_barcode_cloud.models.scan_base64_request import ScanBase64Request
|