Skip to main content

A barcode scanner component for NiceGUI applications

Project description

NiceGUI barcode scanner app

PyPI version Release

This project demonstrates how to create a barcode scanner using the ZXing library wrapped in a NiceGUI custom Vue component. Based on this discussion, and inspired by the custom vue component example.

Usage

Install the package from PyPI:

pip install nicegui nicegui-scanner

Basic Example

Create a simple barcode scanner app (save as scanner_app.py):

from nicegui import ui
from nicegui_scanner import BarcodeScanner

def on_scan(event):
    ui.notify(f"Scanned: {event.args}")

scanner = BarcodeScanner(on_scan=on_scan)
scanner.create_controls()

ui.run()

Then run: python scanner_app.py

Features

  • Easy Integration: Drop-in component for NiceGUI apps - no additional setup require after pip install
  • Camera Selection: Automatic camera detection with settings UI
  • Flexible Styling: Use standard CSS via .style() method
  • Multiple Formats: Supports QR codes, barcodes, and more via ZXing

Examples

See the examples/ directory for:

  • app.py - Multiple scanner configurations
  • pages.py - Usage with NiceGUI pages

Development

To develop this component, install dependencies and run the hello world app:

npm install  # Install ZXing library
uv sync      # Install Python dependencies
make dev     # Run example app

This will start the example app on http://localhost:3001 with multiple scanner demos.

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

nicegui_scanner-0.1.4.tar.gz (316.1 kB view details)

Uploaded Source

Built Distribution

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

nicegui_scanner-0.1.4-py3-none-any.whl (106.0 kB view details)

Uploaded Python 3

File details

Details for the file nicegui_scanner-0.1.4.tar.gz.

File metadata

  • Download URL: nicegui_scanner-0.1.4.tar.gz
  • Upload date:
  • Size: 316.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for nicegui_scanner-0.1.4.tar.gz
Algorithm Hash digest
SHA256 7b77ca85574cdfc764c6342277999b90826387263a5de33e3fd6bbae0c07e30f
MD5 e348a4010fee6d9a6427499318ac53de
BLAKE2b-256 a59af7a68c0eb59b7cb3fff24fbcad5e2a9cb580285cc049cdae10f7808a1b35

See more details on using hashes here.

Provenance

The following attestation bundles were made for nicegui_scanner-0.1.4.tar.gz:

Publisher: release.yml on serraict/nicegui-scanner-app

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nicegui_scanner-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: nicegui_scanner-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 106.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for nicegui_scanner-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 06a92ad19dac5e12eecb4d91d6222d585e3208f9f0a086a8fe782341ec1f72f0
MD5 26662fb6eae727203233934ba831f3ad
BLAKE2b-256 2e2365c644e1aabcf641c687f4bb3411e1417870463b767ff2ec7888ff6f4e83

See more details on using hashes here.

Provenance

The following attestation bundles were made for nicegui_scanner-0.1.4-py3-none-any.whl:

Publisher: release.yml on serraict/nicegui-scanner-app

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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