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 example 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.4.0.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.4.0-py3-none-any.whl (106.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nicegui_scanner-0.4.0.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.4.0.tar.gz
Algorithm Hash digest
SHA256 f0c90409c58378911d291693714253854fe7e16774cd441425a6e11a91eb20f8
MD5 b492d0d6342100891ffa68b7b6bd5cb7
BLAKE2b-256 447724e221caf44f659c5254e99a19f8a79576e81958cd6eea3fc89de609b8b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for nicegui_scanner-0.4.0.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.4.0-py3-none-any.whl.

File metadata

  • Download URL: nicegui_scanner-0.4.0-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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eefea899d3ab65a745f984938f3e0d2aa324f9752f4b52cc7c168088dff62436
MD5 c9b99e27e202f03e8e263b5c1c677242
BLAKE2b-256 06fe6cd918af914e36247f9a5c2668e006d2733c46aba8a65880a304e2edab99

See more details on using hashes here.

Provenance

The following attestation bundles were made for nicegui_scanner-0.4.0-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