A barcode scanner component for NiceGUI applications
Project description
NiceGUI barcode scanner app
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 configurationspages.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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b77ca85574cdfc764c6342277999b90826387263a5de33e3fd6bbae0c07e30f
|
|
| MD5 |
e348a4010fee6d9a6427499318ac53de
|
|
| BLAKE2b-256 |
a59af7a68c0eb59b7cb3fff24fbcad5e2a9cb580285cc049cdae10f7808a1b35
|
Provenance
The following attestation bundles were made for nicegui_scanner-0.1.4.tar.gz:
Publisher:
release.yml on serraict/nicegui-scanner-app
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nicegui_scanner-0.1.4.tar.gz -
Subject digest:
7b77ca85574cdfc764c6342277999b90826387263a5de33e3fd6bbae0c07e30f - Sigstore transparency entry: 443786603
- Sigstore integration time:
-
Permalink:
serraict/nicegui-scanner-app@84c62185d6928a8b5552c058ad74bbf4d43fc6f7 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/serraict
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@84c62185d6928a8b5552c058ad74bbf4d43fc6f7 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06a92ad19dac5e12eecb4d91d6222d585e3208f9f0a086a8fe782341ec1f72f0
|
|
| MD5 |
26662fb6eae727203233934ba831f3ad
|
|
| BLAKE2b-256 |
2e2365c644e1aabcf641c687f4bb3411e1417870463b767ff2ec7888ff6f4e83
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nicegui_scanner-0.1.4-py3-none-any.whl -
Subject digest:
06a92ad19dac5e12eecb4d91d6222d585e3208f9f0a086a8fe782341ec1f72f0 - Sigstore transparency entry: 443786609
- Sigstore integration time:
-
Permalink:
serraict/nicegui-scanner-app@84c62185d6928a8b5552c058ad74bbf4d43fc6f7 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/serraict
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@84c62185d6928a8b5552c058ad74bbf4d43fc6f7 -
Trigger Event:
push
-
Statement type: