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 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.
Metadata
Release files for nicegui-scanner 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nicegui_scanner-0.4.0.tar.gz | 316.1 kB | With provenance | Details for nicegui_scanner-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nicegui_scanner-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for nicegui_scanner-0.4.0-py3-none-any.whl |
Total release size: 422.1 kB
Release files / nicegui_scanner-0.4.0.tar.gz
| Download URL | nicegui_scanner-0.4.0.tar.gz |
|---|---|
| Size | 316.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f0c90409c58378911d291693714253854fe7e16774cd441425a6e11a91eb20f8
|
|
BLAKE2b-256 checksum How to use checksums |
447724e221caf44f659c5254e99a19f8a79576e81958cd6eea3fc89de609b8b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 28, 2025.
Transparency logRelease files / nicegui_scanner-0.4.0-py3-none-any.whl
| Download URL | nicegui_scanner-0.4.0-py3-none-any.whl |
|---|---|
| Size | 106.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eefea899d3ab65a745f984938f3e0d2aa324f9752f4b52cc7c168088dff62436
|
|
BLAKE2b-256 checksum How to use checksums |
06fe6cd918af914e36247f9a5c2668e006d2733c46aba8a65880a304e2edab99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 28, 2025.
Transparency logSecurity for nicegui-scanner 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for nicegui_scanner-0.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 28, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.