Skip to content

Hintay/py-zebra-scanner-windows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zebra Scanner Python Extension for Windows

This is Windows version of Zebra Scanner python extension.

For the original Linux version, see https://github.com/dayjaby/zebra-scanner

Built With

Supported boards

Developed based on DS8108 model.

More boards please check https://www.zebra.cn/us/en/support-downloads/software/developer-tools/scanner-sdk-for-windows.html

Features

  • Scanner added and removed decorator
  • Get, set and store attributes for scanners
  • Barcode scanned decorator
  • Barcode type ID to symbology type supported
  • Barcode symbology types enumeration (Optional, with C++ 17)
  • Full __repr__ supported

Note: Scanners added after the open() command will have no PID and VID information.

Building

Requirements:

A minimal example

import time
from zebra_scanner import CoreScanner

cs = CoreScanner()


@cs.on_scanner_added
def on_scanner_added(scanner):
    print("New scanner found:", scanner)
    scanner.pull_trigger()
    
    print(scanner.fetch_attributes([20004, 535]))
    
    @scanner.on_barcode
    def on_barcode(barcode):
        print("Scanned:", barcode)


@cs.on_scanner_removed
def on_scanner_removed(scanner):
    print("Scanner removed:", scanner)
    scanner.release_trigger()

cs.open()
while True:
    time.sleep(0.1)
    # do nothing while the scanner is reading in continous mode

Running the example

The run result masks the serial number and GUID.

> python zebra_test.py
New scanner found: Scanner(type='SNAPI', scannerID=1, serialnumber='21064010xxxxxx', GUID='358929B1EDF24E0180A0C181xxxxxxxx', PID='6400', VID='1504', modelnumber='DS8108-SR00007ZZCN', DoM='05MAR21', firmware='PAACZS00-006-R02')

[Attribute(id=20004, permission='R', datatype='S', value='PAACZS00-006-R02  '), Attribute(id=535, permission='R', datatype='S', value='05MAR21')]

Scanned: Barcode(code='4974365862466', type='11', symbology='EAN-13')

Scanner removed: Scanner(type='SNAPI', scannerID=1, serialnumber='21064010xxxxxx', GUID='358929B1EDF24E0180A0C181xxxxxxxx', PID='6400', VID='1504', modelnumber='DS8108-SR00007ZZCN', DoM='05MAR21', firmware='PAACZS00-006-R02')

About

This project was created by Hintay based on the Linux version by dayjaby.

License

This project is provided under a MPL 2.0 license that can be found in the LICENSE file. By using, distributing, or contributing to this project, you agree to the terms and conditions of this license.

About

Scan barcodes in python with Zebra Scanner for Windows

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published