Skip to content

Commit a8eb9c8

Browse files
update to v8.8.0
1 parent 85c3f0e commit a8eb9c8

Some content is hidden

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

57 files changed

+979
-1788
lines changed

.gitignore

-6
This file was deleted.

.travis.yml

-96
This file was deleted.

LICENSE.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
License Notice
2+
3+
This folder contains code samples ("Sample Code") for use with Dynamsoft Barcode Reader, a commercial software development kit licensed by Dynamsoft. The Sample Code may be modified and included in your end user software under the terms of the Dynamsoft Software License Agreement   https://www.dynamsoft.com/barcode-reader/license-agreement/ (“Commercial License”). Except as expressly stated in the Commercial License, no other rights are granted in the Sample Code. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4+
5+
Copyright © 2003–2021 Dynamsoft. All rights reserved.

README.md

+36-175
Original file line numberDiff line numberDiff line change
@@ -1,196 +1,57 @@
1-
# Welcome to Dynamsoft Barcode Reader - Python Edition
1+
# Dynamsoft Barcode Reader samples for Python edition
2+
23
[![Current version number](https://img.shields.io/pypi/v/dbr?color=orange)](https://pypi.org/project/dbr/)
34
[![Supported Python versions](https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8%20%7C%203.9-blue)](https://www.python.org/downloads/)
45
[![PyPI downloads](https://img.shields.io/pypi/dm/dbr)](https://pypistats.org/packages/dbr)
56

67
![Dynamsoft](https://dynamsoft.github.io/styleguide/assets/images/icons/dynamsoft_logos/dynamsoft_logo_original.png "Dynamsoft")
78

8-
## What You Should Know
9-
- [![](https://img.shields.io/badge/Download-Offline%20SDK-orange)](https://www.dynamsoft.com/barcode-reader/downloads)
10-
- [![](https://img.shields.io/badge/Get-30--day%20FREE%20Trial%20License-blue)](https://www.dynamsoft.com/customer/license/trialLicense/?product=dbr)
11-
12-
**[Dynamsoft's Barcode Reader SDK](https://www.dynamsoft.com/barcode-reader/overview/?utm_source=github) enables you to efficiently embed barcode reading functionality in your web, desktop or mobile application using just a few lines of code. Saving you months of added development time and resources, our SDK can create high-speed and reliable barcode scanner software applications to meet your business needs.**
13-
14-
## Dynamsoft Barcode Reader - Python Edition
15-
16-
*Dynamsoft Barcode Reader's Python Edition comes with all the general features of Dynamsoft Barcode Reader, bringing convenience for customers who develop in Python. In addition, you could refer to the Python samples available in our [Github](https://github.com/dynamsoft-dbr/python-barcode) when building your own application. If you have any inquiries about our product, please contact us at [email protected]. If you need more information, please check out our [documentation site](https://www.dynamsoft.com/barcode-reader/programming/python/?utm_source=github).*
17-
18-
## Table Of Contents
19-
- [Version](#version)
20-
- [Supported Python Version](#supported-python-version)
21-
- [Supported Platforms](#supported-platforms)
22-
- [Installation](#installation)
23-
- [Supported Symbologies](#supported-symbologies)
24-
- [Release Notes](#release-notes)
25-
- [Interfaces](#interfaces)
26-
- [Enumerations](#enum-interfaces)
27-
- [Classes](#Classes)
28-
- [Main Class Interface](#main-class-interface)
29-
- [Appendix](#appendix)
30-
- [Code Snippet](#code-snippet)
31-
- [Contact Us](#contact-us)
9+
## Overview
3210

33-
### Version
11+
This repository contains multiple samples that demonstrates how to use the [Dynamsoft Barcode Reader](https://www.dynamsoft.com/barcode-reader/overview/) Python Edition.
3412

35-
- **8.6**
13+
## Requirements
3614

3715
### Supported Platforms
38-
- **Windows x64**
16+
- Windows x64
17+
- Linux(x64, ARM32, ARM64)
18+
- macOS(10.15+)
3919

40-
- **Linux(x64, ARM32, ARM64)**
20+
### Supported Python Versions
4121

42-
- **macOS(10.15+)**
22+
- Python3.6
23+
- Python3.7
24+
- Python3.8
25+
- Python3.9
4326

44-
### Supported Python Versions
27+
## Installation
4528

46-
- **Python3.6**
29+
>**pip install dbr** or **pip3 install dbr**
4730
48-
- **Python3.7**
31+
## Samples
4932

50-
- **Python3.8**
33+
| Sample Name | Description |
34+
| ----------- | ----------- |
35+
| `hello-world` | This is a python sample that illustrates the simplest way to recognize barcodes from images with Dynamsoft Barcode Reader SDK. |
36+
| `general-settings` | This is a python sample that illustrates how to make general settings (including barcode format/barcode count/scan region) when using Dynamsoft Barcode Reader. |
37+
| `image-decoding` | This is a python sample that illustrates how to decode images in various format (including file bytes/opencv image/image raw buffer) when using Dynamsoft Barcode Reader. |
38+
| `video-decoding` | This is a python sample that illustrates how to decode video from a file or camera when using Dynamsoft Barcode Reader. |
39+
| `video-decoding-for-picamera` | This is a python sample that illustrates how to decode videos from PiCamera in the Raspberry Pi when using Dynamsoft Barcode Reader. |
40+
| `batch-decode` | This is a python sample that shows how to decode image files in a specified folder. |
41+
| `speed-first-settings` | This is a python sample that shows how to configure Dynamsoft Barcode Reader to read barcodes as fast as possible. The downside is that read-rate and accuracy might be affected. |
42+
| `read-rate-first-settings` | This is a python sample that shows how to configure Dynamsoft Barcode Reader to read as many barcodes as possible at one time. The downside is that speed and accuracy might be affected. It is recommended to apply these configurations when decoding multiple barcodes from a single image. |
43+
| `accuracy-first-settings` | This is a python sample that shows how to configure Dynamsoft Barcode Reader to read barcodes as accurately as possible. The downside is that speed and read-rate might be affected. It is recommended to apply these configurations when misreading is unbearable. |
44+
| `read-dpm-barcode` | This is a python sample that shows how to configure Dynamsoft Barcode Reader to read DPM barcodes. |
5145

52-
- **Python3.9**
46+
## Documentation
5347

54-
### Installation
48+
https://www.dynamsoft.com/barcode-reader/programming/python/?ver=latest&utm_source=samples
5549

56-
>**pip install dbr** or **pip3 install dbr**
50+
## License
51+
52+
- If you want to use an offline license, please contact [Dynamsoft Support](https://www.dynamsoft.com/company/contact/)
53+
- You can also request a 30-day trial license in the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=samples&package=python)
5754

55+
## Contact Us
5856

59-
### Supported Symbologies
60-
*We support all major barcodes symbologies across a variety of industries such as government, finance, retail, warehouse inventory, and healthcare.*
61-
62-
- **Linear Barcodes (1D)** :
63-
- Code 39 *(including Code 39 Extended)*
64-
- Code 93
65-
- Code 128
66-
- Codabar
67-
- Interleaved 2 of 5
68-
- EAN-8
69-
- EAN-13
70-
- UPC-A
71-
- UPC-E
72-
- Industrial 2 of 5
73-
- MSI Code
74-
- **2D Barcodes** :
75-
- QR Code *(including Micro QR Code)*
76-
- Data Matrix
77-
- PDF417 *(including Micro PDF417)*
78-
- Aztec Code
79-
- MaxiCode *(mode 2-5)*
80-
- **Patch Code**
81-
- **GS1 Composite Code**
82-
- **GS1 DataBar** :
83-
- Omnidirectional
84-
- Truncated
85-
- Stacked
86-
- Stacked Omnidirectional
87-
- Limited
88-
- Expanded
89-
- Expanded Stacked
90-
- **Postal Codes** :
91-
- USPS Intelligent Mail
92-
- Postnet
93-
- Planet
94-
- Australian Post
95-
- UK Royal Mail
96-
97-
### Release Notes
98-
99-
https://www.dynamsoft.com/barcode-reader/programming/python/?ver=latest&utm_source=github#release-notes
100-
101-
### Interfaces
102-
103-
#### Enumerations
104-
https://www.dynamsoft.com/barcode-reader/programming/python/api-reference/?ver=latest&utm_source=github#enumerations
105-
106-
#### Classes
107-
https://www.dynamsoft.com/barcode-reader/programming/python/api-reference/?ver=latest&utm_source=github#classes
108-
109-
#### Main Class Interface
110-
https://www.dynamsoft.com/barcode-reader/programming/python/api-reference/?ver=latest&utm_source=github#barcodereader-methods
111-
112-
### Appendix
113-
114-
#### Code Snippet
115-
116-
```
117-
import os
118-
import sys
119-
import cv2
120-
import json
121-
from typing import List
122-
from dbr import *
123-
124-
# you can replace the following variables' value with yours.
125-
license_key = "Input your own license"
126-
#license_server = "Input the name/IP of the license server"
127-
json_file = r"Please input your own template path"
128-
image = r"Please input your own image path"
129-
130-
## The code snippet below shows how to use the full license in DBR 8.x:
131-
# connection_paras = BarcodeReader.init_lts_connection_parameters()
132-
## If DBR service is already built on your server, you can fill in the address of your server, or leave this property's default value.
133-
# connection_paras.main_server_url = "Input your own server url"
134-
# connection_paras.handshake_code = "Input your own handshake"
135-
# connection_paras.deployment_type = EnumDMDeploymentType.DM_DT_DESKTOP
136-
# connection_paras.uuid_generation_method = EnumDMUUIDGenerationMethod.DM_UUIDGM_RANDOM
137-
# try:
138-
# error = BarcodeReader.init_license_from_lts(connection_paras)
139-
# if error[0] != EnumErrorCode.DBR_OK:
140-
# print(error[1])
141-
# except BarcodeReaderError as bre:
142-
# print(bre)
143-
144-
reader = BarcodeReader()
145-
146-
reader.init_license(license_key)
147-
#reader.init_license_from_server(license_server, license_key)
148-
#license_content = reader.output_license_to_string()
149-
#reader.init_license_from_license_content(license_key, license_content)
150-
151-
152-
153-
error = reader.init_runtime_settings_with_file(json_file)
154-
if error[0] != EnumErrorCode.DBR_OK:
155-
print(error[1])
156-
157-
if sys.version_info.major == 3 and sys.version_info.minor >= 6:
158-
159-
try:
160-
text_results:List[TextResult] = reader.decode_file(image)
161-
162-
if text_results != None:
163-
for text_result in text_results:
164-
print("Barcode Format : ")
165-
print(text_result.barcode_format_string)
166-
print("Barcode Text : ")
167-
print(text_result.barcode_text)
168-
print("Localization Points : ")
169-
print(text_result.localization_result.localization_points)
170-
print("Exception : ")
171-
print(text_result.exception)
172-
print("-------------")
173-
except BarcodeReaderError as bre:
174-
print(bre)
175-
176-
else:
177-
try:
178-
text_results = reader.decode_file(image)
179-
180-
if text_results != None:
181-
for text_result in text_results:
182-
print("Barcode Format : ")
183-
print(text_result.barcode_format_string)
184-
print("Barcode Text :")
185-
print(text_result.barcode_text)
186-
print("Localization Points : ")
187-
print(text_result.localization_result.localization_points)
188-
print("Exception : ")
189-
print(text_result.exception)
190-
print("-------------")
191-
except BarcodeReaderError as bre:
192-
print(bre)
193-
```
194-
195-
### Contact Us
196-
57+
https://www.dynamsoft.com/company/contact/

0 commit comments

Comments
 (0)