Read QR code
Description
This is a simple python script that reads a QR code from an image and prints the result. It uses the WeChat QR code reader API in OpenCV to read the QR code from a CV2 image.
Requirements
Important: This package requires opencv-contrib-python, NOT the standard opencv-python package.
Installation
Option 1: Install from pip (recommended)
pip install readQR
Option 2: Install from source
# Clone the repository
git clone https://github.com/CollinsWakholi/QR_Code.git
cd QR_Code
# Uninstall any existing opencv packages to avoid conflicts
pip uninstall opencv-python opencv-contrib-python -y
# Install dependencies (opencv-contrib-python includes all standard OpenCV features)
pip install -r requirements.txt
Note: If you have opencv-python installed, you MUST uninstall it first:
pip uninstall opencv-python opencv-contrib-python -y
pip install opencv-contrib-python>=4.5.0
The WeChat QR code detector is only available in opencv-contrib-python, not in the standard opencv-python package. Having both installed can cause conflicts.
Verify Installation
After installation, verify everything is set up correctly:
python check_installation.py
Usage
from readQR import ReadQR
import readQR.wechat_artefacts as artefacts
import cv2
art_dir = artefacts.__path__[0]
img = cv2.imread('test.png')
reader = ReadQR(artefact_path=art_dir)
show = None # Set to "single" or "continuous" to show the image with the QR code highlighted for single or continuous frames (video)
result = reader.decode(img, show=show)
[print(r) for r in result]
Sample input and output images
Input images
Output images
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
None
Acknowledgemnts
I am gratefully acknowledge Devin Rippner, ORISE, and the USDA for their invaluable assistance and funding support in the development of this Repo. This project would not have been possible without their guidance and opportunities provided.
Metadata
Release files for readQR 0.0.3
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 |
|---|---|---|---|---|
| readqr-0.0.3.tar.gz | 926.5 kB | Without provenance | Details for readqr-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| readqr-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for readqr-0.0.3-py3-none-any.whl |
Total release size: 1.9 MB
Release files / readqr-0.0.3.tar.gz
| Download URL | readqr-0.0.3.tar.gz |
|---|---|
| Size | 926.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8034d94a362a5e835b6df9fc4e8adbbcf99728e141053e7c8211755e4cfd6f3
|
|
BLAKE2b-256 checksum How to use checksums |
6382e579543f33f95cb66eeeec674232e15fb68b95e1fda8c65d7bceee83efae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / readqr-0.0.3-py3-none-any.whl
| Download URL | readqr-0.0.3-py3-none-any.whl |
|---|---|
| Size | 924.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e74d943947fba6c0d139822ccab65c066f85dcfd25d5041e1e0be5ce4fad78f5
|
|
BLAKE2b-256 checksum How to use checksums |
83870b9a98aafaee203d7dd186baf9ccdb31035dbd5150bfb74e0cebb9f45b54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Security for readQR 0.0.3
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.