Skip to content

Commit 9477188

Browse files
authored
Release 24.7 (#78)
* Insert example.py into README.md * Bump version to 24.7 * Format scripts
1 parent 375f64f commit 9477188

33 files changed

Lines changed: 73 additions & 98 deletions

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dist:
2222

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

2727
.PHONY: format_doc
2828
format_doc:
@@ -75,12 +75,16 @@ test-example:
7575
test-tox:
7676
python -m tox $(SRC)
7777

78+
.PHONY: insert-examples
79+
insert-examples:
80+
./scripts/insert-example.bash
81+
7882
.PHONY: add-warnings
7983
add-warnings:
8084
./scripts/add-deprecation-warnings.bash
8185

8286
.PHONY: after-gen
83-
after-gen: format add-warnings format_doc
87+
after-gen: format insert-examples add-warnings format_doc
8488

8589
.PHONY: update
8690
update:

README.md

Lines changed: 21 additions & 22 deletions
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.6.0
8+
- Package version: 24.7.0
99

1010
## Demo applications
1111

@@ -54,38 +54,36 @@ import aspose_barcode_cloud
5454
The examples below show how you can generate and recognize Code128 barcode and save it into local file using aspose-barcode-cloud:
5555

5656
```python
57-
from __future__ import division, print_function
58-
57+
import os
5958
from pprint import pprint
6059

61-
import aspose_barcode_cloud
62-
from aspose_barcode_cloud.rest import ApiException
60+
from aspose_barcode_cloud import (
61+
BarcodeApi,
62+
ApiClient,
63+
Configuration,
64+
EncodeBarcodeType,
65+
CodeLocation,
66+
DecodeBarcodeType,
67+
)
6368

64-
# Configure OAuth2 access token for authorization: JWT
65-
configuration = aspose_barcode_cloud.Configuration(
69+
config = Configuration(
6670
client_id="Client Id from https://dashboard.aspose.cloud/applications",
6771
client_secret="Client Secret from https://dashboard.aspose.cloud/applications",
72+
access_token=os.environ.get("TEST_CONFIGURATION_ACCESS_TOKEN"), # Only for testing in CI, remove this line
6873
)
6974

70-
# create an instance of the API class
71-
api = aspose_barcode_cloud.BarcodeApi(aspose_barcode_cloud.ApiClient(configuration))
72-
type = aspose_barcode_cloud.EncodeBarcodeType.CODE128 # str | Type of barcode to generate.
73-
text = 'text_example' # str | Text to encode.
74-
75-
try:
76-
# Generate barcode.
77-
response = api.get_barcode_generate(type, text)
78-
with open("example.png", "wb") as f:
79-
f.write(response.data)
80-
print("Barcode saved to file 'example.png'")
81-
except ApiException as e:
82-
print("Exception when calling BarcodeApi->get_barcode_generate: %s\n" % e)
75+
api = BarcodeApi(ApiClient(config))
8376

77+
# Generate barcode
78+
response = api.get_barcode_generate(EncodeBarcodeType.QR, "Example", text_location=CodeLocation.NONE)
79+
with open("example.png", "wb") as f:
80+
f.write(response.data)
81+
print("Barcode saved to file 'example.png'")
8482

8583
# Recognize barcode
86-
response = api.post_barcode_recognize_from_url_or_content(image="example.png",
87-
preset=aspose_barcode_cloud.PresetType.HIGHPERFORMANCE)
84+
response = api.scan_barcode("example.png", decode_types=[DecodeBarcodeType.QR])
8885
pprint(response)
86+
8987
```
9088

9189
## Requirements
@@ -216,3 +214,4 @@ Class | Method | HTTP request | Description
216214
- [TextAlignment](docs/TextAlignment.md)
217215
- [FileVersion](docs/FileVersion.md)
218216

217+

aspose_barcode_cloud/__init__.py

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

33
# flake8: noqa: F401
44

5-
from __future__ import absolute_import
6-
75
from aspose_barcode_cloud.rest import ApiException
86

97
# import apis into sdk package

aspose_barcode_cloud/api/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import absolute_import
2-
31
# flake8: noqa
42

53
# import apis into api package

aspose_barcode_cloud/api/barcode_api.py

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

3-
from __future__ import absolute_import, division
4-
53
import re # noqa: F401
64
import warnings # noqa: F401
75

aspose_barcode_cloud/api/file_api.py

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

3-
from __future__ import absolute_import, division
4-
53
import re # noqa: F401
64
import warnings # noqa: F401
75

aspose_barcode_cloud/api/folder_api.py

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

3-
from __future__ import absolute_import, division
4-
53
import re # noqa: F401
64
import warnings # noqa: F401
75

aspose_barcode_cloud/api/storage_api.py

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

3-
from __future__ import absolute_import, division
4-
53
import re # noqa: F401
64
import warnings # noqa: F401
75

aspose_barcode_cloud/api_client.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# coding: utf-8
22

3-
from __future__ import absolute_import, division
4-
53
import datetime
64
import io
75
import json
@@ -62,13 +60,13 @@ def __init__(self, configuration=None, header_name=None, header_value=None, cook
6260
self.rest_client = RESTClientObject(configuration)
6361
self.default_headers = {
6462
"x-aspose-client": "python sdk",
65-
"x-aspose-client-version": "24.6.0",
63+
"x-aspose-client-version": "24.7.0",
6664
}
6765
if header_name is not None:
6866
self.default_headers[header_name] = header_value
6967
self.cookie = cookie
7068
# Set default User-Agent.
71-
self.user_agent = "Aspose-Barcode-SDK/24.6.0/python"
69+
self.user_agent = "Aspose-Barcode-SDK/24.7.0/python"
7270

7371
def __del__(self):
7472
self.rest_client.close()

aspose_barcode_cloud/configuration.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# coding: utf-8
22

3-
from __future__ import absolute_import, division
4-
53
import contextlib
64
import copy
75
import json
@@ -260,7 +258,7 @@ def to_debug_report(self):
260258
"OS: {env}\n"
261259
"Python Version: {pyversion}\n"
262260
"Version of the API: 3.0\n"
263-
"SDK Package Version: 24.6.0".format(env=sys.platform, pyversion=sys.version)
261+
"SDK Package Version: 24.7.0".format(env=sys.platform, pyversion=sys.version)
264262
)
265263

266264
@staticmethod

0 commit comments

Comments
 (0)