Aspose.BarCode Cloud SDK for Python
- API version: 4.0
- Package version: 26.9.0
SDK and API Version Compatibility:
- SDK Version 25.1 and Later: Starting from SDK version 25.1, all subsequent versions are compatible with API Version v4.0.
- SDK Version 24.12 and Earlier: These versions are compatible with API Version v3.0.
Demo applications
| Scan QR | Generate Barcode | Recognize Barcode |
|---|---|---|
| Generate Wi-Fi QR | Embed Barcode | Scan Barcode |
Aspose.BarCode for 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.
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.
Supported Python versions:
- Python 3.9+
To use these SDKs, you will need Client Id and Client Secret which can be looked up at Aspose Cloud Dashboard (free registration in Aspose Cloud is required for this).
How to use the SDK
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 (recommended).
AI Agent Skills
This repository includes an AI-agent skill in skills/generate-and-scan-barcode-python/SKILL.md. Point your coding agent to it when working with this SDK so it follows the repo workflow and SDK-specific API patterns.
Prerequisites
To use Aspose.BarCode Cloud SDK for Python you need to register an account with Aspose Cloud and lookup/create Client Secret and Client Id at Cloud Dashboard. There is free quota available. For more details, see Aspose Cloud Pricing.
Installation
Install aspose-barcode-cloud via pip
From the command line:
pip install aspose-barcode-cloud
Then import the package:
import aspose_barcode_cloud
Sample usage
The examples below show how you can generate and recognize Code128 barcode and save it into local file using aspose-barcode-cloud:
import os
from pprint import pprint
from aspose_barcode_cloud import (
GenerateApi,
RecognizeApi,
ApiClient,
Configuration,
EncodeBarcodeType,
CodeLocation,
DecodeBarcodeType,
BarcodeImageParams,
QrParams,
QREncodeMode,
QRErrorLevel,
QRVersion,
)
config = Configuration(
client_id="Client Id from https://dashboard.aspose.cloud/applications",
client_secret="Client Secret from https://dashboard.aspose.cloud/applications",
access_token=os.environ.get("TEST_CONFIGURATION_ACCESS_TOKEN"), # Only for testing in CI, remove this line
)
# Generate barcode
generateApi = GenerateApi(ApiClient(config))
response = generateApi.generate(
EncodeBarcodeType.QR,
"Example",
barcode_image_params=BarcodeImageParams(text_location=CodeLocation.NONE),
qr_params=QrParams(
qr_encode_mode=QREncodeMode.AUTO,
qr_error_level=QRErrorLevel.LEVELM,
qr_version=QRVersion.AUTO,
qr_aspect_ratio=0.75,
),
)
with open("example.png", "wb") as f:
f.write(response.data)
print("Barcode saved to file 'example.png'")
# Recognize barcode
recognizeApi = RecognizeApi(ApiClient(config))
response = recognizeApi.recognize_multipart(DecodeBarcodeType.QR, open("example.png", "rb"))
pprint(response)
Requirements
- urllib3 >= 1.21.1, <2.0
Licensing
All Aspose.BarCode for Cloud SDKs, helper scripts and templates are licensed under MIT License.
Resources
Documentation for API Endpoints
All URIs are relative to https://api.aspose.cloud/v4.0
| Class | Method | HTTP request | Description |
|---|---|---|---|
| GenerateApi | generate | GET /barcode/generate/{barcodeType} | Generate a barcode using a GET request with parameters in the route and query string. |
| GenerateApi | generate_body | POST /barcode/generate-body | Generate a barcode using a POST request with parameters in the request body in JSON or XML format. |
| GenerateApi | generate_multipart | POST /barcode/generate-multipart | Generate a barcode using a POST request with parameters in a multipart form. |
| RecognizeApi | recognize | GET /barcode/recognize | Recognize a barcode from a file on an Internet server using a GET request with a query string parameter. For recognizing files from your hard drive, use `recognize-body` or `recognize-multipart` endpoints instead. |
| RecognizeApi | recognize_base64 | POST /barcode/recognize-body | Recognize a barcode from a file in the request body using a POST request with JSON or XML body parameters. |
| RecognizeApi | recognize_multipart | POST /barcode/recognize-multipart | Recognize a barcode from a file in the request body using a POST request with multipart form parameters. |
| ScanApi | scan | GET /barcode/scan | Scan a barcode from a file on an Internet server using a GET request with a query string parameter. For scanning files from your hard drive, use `scan-body` or `scan-multipart` endpoints instead. |
| ScanApi | scan_base64 | POST /barcode/scan-body | Scan a barcode from a file in the request body using a POST request with a JSON or XML body parameter. |
| ScanApi | scan_multipart | POST /barcode/scan-multipart | Scan a barcode from a file in the request body using a POST request with a multipart form parameter. |
Documentation For Models
- ApiError
- ApiErrorResponse
- BarcodeImageFormat
- BarcodeImageParams
- BarcodeResponse
- BarcodeResponseList
- Code128EncodeMode
- Code128Params
- CodeLocation
- DecodeBarcodeType
- ECIEncodings
- EncodeBarcodeType
- EncodeData
- EncodeDataType
- GenerateParams
- GraphicsUnit
- MacroCharacter
- MicroQRVersion
- Pdf417EncodeMode
- Pdf417ErrorLevel
- Pdf417Params
- QREncodeMode
- QRErrorLevel
- QRVersion
- QrParams
- RecognitionImageKind
- RecognitionMode
- RecognizeBase64Request
- RectMicroQRVersion
- RegionPoint
- ScanBase64Request
Release files for aspose-barcode-cloud 26.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aspose_barcode_cloud-26.9.0.tar.gz | 47.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aspose_barcode_cloud-26.9.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 115.2 kB
Release files / aspose_barcode_cloud-26.9.0.tar.gz
| Download URL | aspose_barcode_cloud-26.9.0.tar.gz |
|---|---|
| Size | 47.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1a98dda59b505967425bfbfa83f3d5b6c4f65e355f7ad396b99d40f6b51be84b
|
|
BLAKE2b-256 checksum How to use checksums |
08c70a089d817a0c94f2eb7c0419a2755ebd57c37ca444c8844d8d9f31be81ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.
Transparency logRelease files / aspose_barcode_cloud-26.9.0-py2.py3-none-any.whl
| Download URL | aspose_barcode_cloud-26.9.0-py2.py3-none-any.whl |
|---|---|
| Size | 67.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
1135b3c5b8312432141a743229fddd793a7152095ebef0db3a89c7fefee45758
|
|
BLAKE2b-256 checksum How to use checksums |
d7fee2d1c815dc4fdbf231d618079e1dc5b407db1b22117793dfe1e572c23d82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.
Transparency log