Skip to content

Commit 2d3ddb3

Browse files
committed
Code and tests added
1 parent 0e49ae9 commit 2d3ddb3

153 files changed

Lines changed: 19389 additions & 2 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1-
aspose_barcode_cloud.egg-info/
2-
build/
1+
*.pyc
2+
.tox/
3+
.coverage
4+
tests/configuration*.json
5+
!tests/configuration.example.json
6+
example.png
7+
dist/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 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.

README.md

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
# Aspose.BarCode Cloud SDK for Python
2+
3+
- API version: 3.0
4+
- Package version: 20.5.0
5+
6+
[Aspose.BarCode for Cloud](https://products.aspose.cloud/barcode/cloud) 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.
7+
8+
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 2 or Python 3 applications quickly and easily.
9+
10+
Supported Python versions:
11+
12+
- Python 2.7
13+
- Python 3.4+
14+
15+
To use these SDKs, you will need App SID and App Key which can be looked up at [Aspose Cloud Dashboard](https://dashboard.aspose.cloud/#/apps) (free registration in Aspose Cloud is required for this).
16+
17+
## How to use the SDK
18+
19+
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).
20+
21+
## Prerequisites
22+
23+
To use Aspose.BarCode Cloud SDK for Python you need to register an account with [Aspose Cloud](https://www.aspose.cloud/) and lookup/create App Key and SID at [Cloud Dashboard](https://dashboard.aspose.cloud/#/apps). There is free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/pricing).
24+
25+
## Installation
26+
27+
### Install aspose-barcode-cloud via pip
28+
29+
From the command line:
30+
31+
```sh
32+
pip install aspose-barcode-cloud
33+
```
34+
35+
Then import the package:
36+
37+
```python
38+
import aspose_barcode_cloud
39+
```
40+
41+
## Sample usage
42+
43+
The examples below show how you can generate and recognize Code128 barcode and save it into local file using aspose-barcode-cloud:
44+
45+
```python
46+
from __future__ import print_function
47+
48+
from pprint import pprint
49+
50+
import aspose_barcode_cloud
51+
from aspose_barcode_cloud.rest import ApiException
52+
53+
# Configure OAuth2 access token for authorization: JWT
54+
configuration = aspose_barcode_cloud.Configuration(
55+
app_sid="App SID from https://dashboard.aspose.cloud/#/apps",
56+
app_key="App Key from https://dashboard.aspose.cloud/#/apps",
57+
)
58+
59+
# create an instance of the API class
60+
api = aspose_barcode_cloud.BarcodeApi(aspose_barcode_cloud.ApiClient(configuration))
61+
type = aspose_barcode_cloud.EncodeBarcodeType.CODE128 # str | Type of barcode to generate.
62+
text = 'text_example' # str | Text to encode.
63+
64+
try:
65+
# Generate barcode.
66+
response = api.get_barcode_generate(type, text)
67+
with open('example.png', 'wb') as f:
68+
f.write(response.data)
69+
print("Barcode saved to file 'example.png'")
70+
except ApiException as e:
71+
print("Exception when calling BarcodeApi->get_barcode_generate: %s\n" % e)
72+
73+
74+
# Recognize barcode
75+
response = api.post_barcode_recognize_from_url_or_content(image='example.png',
76+
preset=aspose_barcode_cloud.PresetType.HIGHPERFORMANCE)
77+
pprint(response)
78+
```
79+
80+
## Requirements
81+
82+
- six >= 1.10
83+
- urllib3 >= 1.15.1
84+
85+
## Licensing
86+
87+
All Aspose.BarCode for Cloud SDKs, helper scripts and templates are licensed under [MIT License](LICENSE).
88+
89+
## Resources
90+
91+
- [**Website**](https://www.aspose.cloud)
92+
- [**Product Home**](https://products.aspose.cloud/barcode/cloud)
93+
- [**Documentation**](https://docs.aspose.cloud/display/barcodecloud/Home)
94+
- [**Free Support Forum**](https://forum.aspose.cloud/c/barcode)
95+
- [**Paid Support Helpdesk**](https://helpdesk.aspose.cloud/)
96+
- [**Blog**](https://blog.aspose.cloud/category/aspose-products/aspose-barcode-product-family/)
97+
98+
## Documentation for API Endpoints
99+
100+
All URIs are relative to *<https://api.aspose.cloud/v3.0>*
101+
102+
Class | Method | HTTP request | Description
103+
------------ | ------------- | ------------- | -------------
104+
*BarcodeApi* | [**get_barcode_generate**](docs/BarcodeApi.md#get_barcode_generate) | **GET** /barcode/generate | Generate barcode.
105+
*BarcodeApi* | [**get_barcode_recognize**](docs/BarcodeApi.md#get_barcode_recognize) | **GET** /barcode/{name}/recognize | Recognize barcode from a file on server.
106+
*BarcodeApi* | [**post_barcode_recognize_from_url_or_content**](docs/BarcodeApi.md#post_barcode_recognize_from_url_or_content) | **POST** /barcode/recognize | Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image or encoded with base64.
107+
*BarcodeApi* | [**post_generate_multiple**](docs/BarcodeApi.md#post_generate_multiple) | **POST** /barcode/generateMultiple | Generate multiple barcodes and return in response stream
108+
*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)
109+
*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.
110+
*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
111+
*FileApi* | [**copy_file**](docs/FileApi.md#copy_file) | **PUT** /barcode/storage/file/copy/{srcPath} | Copy file
112+
*FileApi* | [**delete_file**](docs/FileApi.md#delete_file) | **DELETE** /barcode/storage/file/{path} | Delete file
113+
*FileApi* | [**download_file**](docs/FileApi.md#download_file) | **GET** /barcode/storage/file/{path} | Download file
114+
*FileApi* | [**move_file**](docs/FileApi.md#move_file) | **PUT** /barcode/storage/file/move/{srcPath} | Move file
115+
*FileApi* | [**upload_file**](docs/FileApi.md#upload_file) | **PUT** /barcode/storage/file/{path} | Upload file
116+
*FolderApi* | [**copy_folder**](docs/FolderApi.md#copy_folder) | **PUT** /barcode/storage/folder/copy/{srcPath} | Copy folder
117+
*FolderApi* | [**create_folder**](docs/FolderApi.md#create_folder) | **PUT** /barcode/storage/folder/{path} | Create the folder
118+
*FolderApi* | [**delete_folder**](docs/FolderApi.md#delete_folder) | **DELETE** /barcode/storage/folder/{path} | Delete folder
119+
*FolderApi* | [**get_files_list**](docs/FolderApi.md#get_files_list) | **GET** /barcode/storage/folder/{path} | Get all files and folders within a folder
120+
*FolderApi* | [**move_folder**](docs/FolderApi.md#move_folder) | **PUT** /barcode/storage/folder/move/{srcPath} | Move folder
121+
*StorageApi* | [**get_disc_usage**](docs/StorageApi.md#get_disc_usage) | **GET** /barcode/storage/disc | Get disc usage
122+
*StorageApi* | [**get_file_versions**](docs/StorageApi.md#get_file_versions) | **GET** /barcode/storage/version/{path} | Get file versions
123+
*StorageApi* | [**object_exists**](docs/StorageApi.md#object_exists) | **GET** /barcode/storage/exist/{path} | Check if file or folder exists
124+
*StorageApi* | [**storage_exists**](docs/StorageApi.md#storage_exists) | **GET** /barcode/storage/{storageName}/exist | Check if storage exists
125+
126+
## Documentation For Models
127+
128+
- [AustralianPostParams](docs/AustralianPostParams.md)
129+
- [AutoSizeMode](docs/AutoSizeMode.md)
130+
- [AvailableGraphicsUnit](docs/AvailableGraphicsUnit.md)
131+
- [AztecParams](docs/AztecParams.md)
132+
- [AztecSymbolMode](docs/AztecSymbolMode.md)
133+
- [BarCodeErrorResponse](docs/BarCodeErrorResponse.md)
134+
- [BarcodeResponse](docs/BarcodeResponse.md)
135+
- [BarcodeResponseList](docs/BarcodeResponseList.md)
136+
- [BorderDashStyle](docs/BorderDashStyle.md)
137+
- [CaptionParams](docs/CaptionParams.md)
138+
- [ChecksumValidation](docs/ChecksumValidation.md)
139+
- [CodabarChecksumMode](docs/CodabarChecksumMode.md)
140+
- [CodabarParams](docs/CodabarParams.md)
141+
- [CodabarSymbol](docs/CodabarSymbol.md)
142+
- [CodablockParams](docs/CodablockParams.md)
143+
- [Code16KParams](docs/Code16KParams.md)
144+
- [CodeLocation](docs/CodeLocation.md)
145+
- [CouponParams](docs/CouponParams.md)
146+
- [CustomerInformationInterpretingType](docs/CustomerInformationInterpretingType.md)
147+
- [DataBarParams](docs/DataBarParams.md)
148+
- [DataMatrixEccType](docs/DataMatrixEccType.md)
149+
- [DataMatrixEncodeMode](docs/DataMatrixEncodeMode.md)
150+
- [DataMatrixParams](docs/DataMatrixParams.md)
151+
- [DecodeBarcodeType](docs/DecodeBarcodeType.md)
152+
- [DiscUsage](docs/DiscUsage.md)
153+
- [DotCodeParams](docs/DotCodeParams.md)
154+
- [ECIEncodings](docs/ECIEncodings.md)
155+
- [EnableChecksum](docs/EnableChecksum.md)
156+
- [EncodeBarcodeType](docs/EncodeBarcodeType.md)
157+
- [Error](docs/Error.md)
158+
- [ErrorDetails](docs/ErrorDetails.md)
159+
- [FileVersions](docs/FileVersions.md)
160+
- [FilesList](docs/FilesList.md)
161+
- [FilesUploadResult](docs/FilesUploadResult.md)
162+
- [FontMode](docs/FontMode.md)
163+
- [FontParams](docs/FontParams.md)
164+
- [FontStyle](docs/FontStyle.md)
165+
- [GeneratorParams](docs/GeneratorParams.md)
166+
- [GeneratorParamsList](docs/GeneratorParamsList.md)
167+
- [ITF14BorderType](docs/ITF14BorderType.md)
168+
- [ITFParams](docs/ITFParams.md)
169+
- [MaxiCodeParams](docs/MaxiCodeParams.md)
170+
- [ObjectExist](docs/ObjectExist.md)
171+
- [Padding](docs/Padding.md)
172+
- [Pdf417CompactionMode](docs/Pdf417CompactionMode.md)
173+
- [Pdf417ErrorLevel](docs/Pdf417ErrorLevel.md)
174+
- [Pdf417Params](docs/Pdf417Params.md)
175+
- [PostalParams](docs/PostalParams.md)
176+
- [PresetType](docs/PresetType.md)
177+
- [QREncodeMode](docs/QREncodeMode.md)
178+
- [QREncodeType](docs/QREncodeType.md)
179+
- [QRErrorLevel](docs/QRErrorLevel.md)
180+
- [QRVersion](docs/QRVersion.md)
181+
- [QrParams](docs/QrParams.md)
182+
- [ReaderParams](docs/ReaderParams.md)
183+
- [RegionPoint](docs/RegionPoint.md)
184+
- [ResultImageInfo](docs/ResultImageInfo.md)
185+
- [StorageExist](docs/StorageExist.md)
186+
- [StorageFile](docs/StorageFile.md)
187+
- [TextAlignment](docs/TextAlignment.md)
188+
- [FileVersion](docs/FileVersion.md)
189+

aspose_barcode_cloud/__init__.py

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# coding: utf-8
2+
3+
# flake8: noqa
4+
5+
"""
6+
7+
Copyright (c) 2020 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+
30+
from __future__ import absolute_import
31+
32+
# import apis into sdk package
33+
from aspose_barcode_cloud.api.barcode_api import BarcodeApi
34+
from aspose_barcode_cloud.api.file_api import FileApi
35+
from aspose_barcode_cloud.api.folder_api import FolderApi
36+
from aspose_barcode_cloud.api.storage_api import StorageApi
37+
38+
# import ApiClient
39+
from aspose_barcode_cloud.api_client import ApiClient
40+
from aspose_barcode_cloud.configuration import Configuration
41+
42+
# import models into sdk package
43+
from aspose_barcode_cloud.models.australian_post_params import AustralianPostParams
44+
from aspose_barcode_cloud.models.auto_size_mode import AutoSizeMode
45+
from aspose_barcode_cloud.models.available_graphics_unit import AvailableGraphicsUnit
46+
from aspose_barcode_cloud.models.aztec_params import AztecParams
47+
from aspose_barcode_cloud.models.aztec_symbol_mode import AztecSymbolMode
48+
from aspose_barcode_cloud.models.bar_code_error_response import BarCodeErrorResponse
49+
from aspose_barcode_cloud.models.barcode_response import BarcodeResponse
50+
from aspose_barcode_cloud.models.barcode_response_list import BarcodeResponseList
51+
from aspose_barcode_cloud.models.border_dash_style import BorderDashStyle
52+
from aspose_barcode_cloud.models.caption_params import CaptionParams
53+
from aspose_barcode_cloud.models.checksum_validation import ChecksumValidation
54+
from aspose_barcode_cloud.models.codabar_checksum_mode import CodabarChecksumMode
55+
from aspose_barcode_cloud.models.codabar_params import CodabarParams
56+
from aspose_barcode_cloud.models.codabar_symbol import CodabarSymbol
57+
from aspose_barcode_cloud.models.codablock_params import CodablockParams
58+
from aspose_barcode_cloud.models.code16_k_params import Code16KParams
59+
from aspose_barcode_cloud.models.code_location import CodeLocation
60+
from aspose_barcode_cloud.models.coupon_params import CouponParams
61+
from aspose_barcode_cloud.models.customer_information_interpreting_type import CustomerInformationInterpretingType
62+
from aspose_barcode_cloud.models.data_bar_params import DataBarParams
63+
from aspose_barcode_cloud.models.data_matrix_ecc_type import DataMatrixEccType
64+
from aspose_barcode_cloud.models.data_matrix_encode_mode import DataMatrixEncodeMode
65+
from aspose_barcode_cloud.models.data_matrix_params import DataMatrixParams
66+
from aspose_barcode_cloud.models.decode_barcode_type import DecodeBarcodeType
67+
from aspose_barcode_cloud.models.disc_usage import DiscUsage
68+
from aspose_barcode_cloud.models.dot_code_params import DotCodeParams
69+
from aspose_barcode_cloud.models.eci_encodings import ECIEncodings
70+
from aspose_barcode_cloud.models.enable_checksum import EnableChecksum
71+
from aspose_barcode_cloud.models.encode_barcode_type import EncodeBarcodeType
72+
from aspose_barcode_cloud.models.error import Error
73+
from aspose_barcode_cloud.models.error_details import ErrorDetails
74+
from aspose_barcode_cloud.models.file_versions import FileVersions
75+
from aspose_barcode_cloud.models.files_list import FilesList
76+
from aspose_barcode_cloud.models.files_upload_result import FilesUploadResult
77+
from aspose_barcode_cloud.models.font_mode import FontMode
78+
from aspose_barcode_cloud.models.font_params import FontParams
79+
from aspose_barcode_cloud.models.font_style import FontStyle
80+
from aspose_barcode_cloud.models.generator_params import GeneratorParams
81+
from aspose_barcode_cloud.models.generator_params_list import GeneratorParamsList
82+
from aspose_barcode_cloud.models.itf14_border_type import ITF14BorderType
83+
from aspose_barcode_cloud.models.itf_params import ITFParams
84+
from aspose_barcode_cloud.models.maxi_code_params import MaxiCodeParams
85+
from aspose_barcode_cloud.models.object_exist import ObjectExist
86+
from aspose_barcode_cloud.models.padding import Padding
87+
from aspose_barcode_cloud.models.pdf417_compaction_mode import Pdf417CompactionMode
88+
from aspose_barcode_cloud.models.pdf417_error_level import Pdf417ErrorLevel
89+
from aspose_barcode_cloud.models.pdf417_params import Pdf417Params
90+
from aspose_barcode_cloud.models.postal_params import PostalParams
91+
from aspose_barcode_cloud.models.preset_type import PresetType
92+
from aspose_barcode_cloud.models.qr_encode_mode import QREncodeMode
93+
from aspose_barcode_cloud.models.qr_encode_type import QREncodeType
94+
from aspose_barcode_cloud.models.qr_error_level import QRErrorLevel
95+
from aspose_barcode_cloud.models.qr_version import QRVersion
96+
from aspose_barcode_cloud.models.qr_params import QrParams
97+
from aspose_barcode_cloud.models.reader_params import ReaderParams
98+
from aspose_barcode_cloud.models.region_point import RegionPoint
99+
from aspose_barcode_cloud.models.result_image_info import ResultImageInfo
100+
from aspose_barcode_cloud.models.storage_exist import StorageExist
101+
from aspose_barcode_cloud.models.storage_file import StorageFile
102+
from aspose_barcode_cloud.models.text_alignment import TextAlignment
103+
from aspose_barcode_cloud.models.file_version import FileVersion
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from __future__ import absolute_import
2+
3+
# flake8: noqa
4+
5+
# import apis into api package
6+
from aspose_barcode_cloud.api.barcode_api import BarcodeApi
7+
from aspose_barcode_cloud.api.file_api import FileApi
8+
from aspose_barcode_cloud.api.folder_api import FolderApi
9+
from aspose_barcode_cloud.api.storage_api import StorageApi

0 commit comments

Comments
 (0)