Skip to main content

For use USB barcode scanners

Project description

USB Scanner

Package allowing to read a barcode or QR-code from USB scanner listed below.

https://sps.honeywell.com/fr/fr/products/productivity/barcode-scanners/general-purpose-handheld/voyager-xp-1470g-general-duty-scanner

https://www.zebra.com/gb/en/products/scanners/general-purpose-scanners/handheld/ls1203.html

Instructions

  1. Install:
pip install usb-scanner
  1. Example of use:
from usb_scanner import Reader

# Initialize Reader object
r = Reader(keymap="UK")

# Waiting for a barcode to be read
r.read()

# If you want have a timeout for the reading
r.read(timeout=10)

Fix udev permissions

Create a Udev rule for the use of USB scanners (hidraw*)

$ sudo nano /etc/udev/rules.d/99-hidraw-permissions.rules

and add the following lines

SUBSYSTEM=="usb", ATTRS{idVendor}=="05e0", ATTRS{idProduct}=="1200", MODE="666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="080c", ATTRS{idProduct}=="0300", MODE="666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0c2e", ATTRS{idProduct}=="1001", MODE="666"

Finally reload the udev rules with the following command

$ sudo udevadm control --reload-rules && sudo udevadm trigger

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

usb_scanner-0.0.5.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

usb_scanner-0.0.5-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file usb_scanner-0.0.5.tar.gz.

File metadata

  • Download URL: usb_scanner-0.0.5.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.2

File hashes

Hashes for usb_scanner-0.0.5.tar.gz
Algorithm Hash digest
SHA256 afad7124934d5e2f811de3207896d7e9996fb9ff2f0f1eac8a0a8abb164b33b5
MD5 4d4c60f8c66fc76584a8e0452b6e0a4b
BLAKE2b-256 49d74429bf59c2c4fbffbec778ba7fc96a9a43b4db37317493c4ad3b6a3efb29

See more details on using hashes here.

File details

Details for the file usb_scanner-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: usb_scanner-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.2

File hashes

Hashes for usb_scanner-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 afec32452f33f680d71da8ad7fafe3c0e584df53f95a70bb5c262b76134b7ada
MD5 829459fea8c89365e098307b10f5ed3b
BLAKE2b-256 55c17f925d35817a13e4432ae9657794800ac418eae435618156da5f6513bb3f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page