This is a package to make micro QR codes.
Project description
mkmqr (MaKe Micro QR code)
This is a package to make micro QR codes.
日本語版のREADMEはこちら
Features
- Efficient encoding of text, use the most of the capacity of the symbol
- Automatically selects the best model from the text
- Maximizes the error correction level with the selected model number
DEMO
| command | generated image |
|---|---|
python -m mkmqr 12345 |
|
python -m mkmqr -p kanji.png 漢字 |
|
python -m mkmqr -p Q.png -e q LevelQ |
|
python -m mkmqr -p github.png HTTPS://GITHUB.COM |
Caution: When reading the micro QR code, please pay attention to security, for example, make sure the URL is correct.
USAGE
Command
Create a micro QR code from error correction level (optional) and text.
description of arguments
| argument | choice | default | |
|---|---|---|---|
| Required error correction level | -e |
x(error detection only), l(L), m(M), q(Q) |
x |
| Path to save ths image | -p |
- | ./(text).png |
| Show the image | -s |
-s |
none |
| Specify encoding | --encoding |
- | shift-jis |
| Show debugging information | -d |
-d, -dd(more information) |
none |
Program
from mkmqr import (
ErrorCorrectionLevel, create_symbol_image,
InvalidCharacterError, InvalidPairError, OverCapacityError
)
try:
image = create_symbol_image('demo', ErrorCorrectionLevel.M)
image.show()
except OverCapacityError:
print('Capacity is exceeded.')
except InvalidCharacterError:
# By default, the final encoding is Shift-JIS.
print('Unencodable characters are used.')
except InvalidPairError:
# May be thrown if model number or other information is specified.
print('The combination of the model or error correction level is incorrect.')
Installation
- from GitHub:
pip install git+https://github.com/tkamiya22/mkmqr.git - from PyPI:
pip install mkmqr
Requirement
Notes
An overview of Micro QR Code can be found at QR code.com.
The detailed specifications can be found at JIX X0510.
The operation is confirmed by QRQR.
QR Code is a registered trademark of DENSO WAVE INCORPORATED.
Author
Toshiki Kamiya
License
MIT license
Project details
Release history Release notifications | RSS feed
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 mkmqr-0.6.2.tar.gz.
File metadata
- Download URL: mkmqr-0.6.2.tar.gz
- Upload date:
- Size: 29.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a99cf3366f6b3ccd5ffde378c90ba79c0b5c5c134337259288f2af4180cb13f
|
|
| MD5 |
21997608bf758f3e1afd6972c4b2b383
|
|
| BLAKE2b-256 |
c845f5616db8e702d77983255454fb069c07791cf50f3aca9ea463fcfda9a2ba
|
File details
Details for the file mkmqr-0.6.2-py3-none-any.whl.
File metadata
- Download URL: mkmqr-0.6.2-py3-none-any.whl
- Upload date:
- Size: 35.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d83a76e204c2938dd9f1326fac8a9a8d163e324df55cd8f10e7ec678c90f1f60
|
|
| MD5 |
e4f8beec1a31bae81d63ba83df8db290
|
|
| BLAKE2b-256 |
85124fa49d14db4ce718a0e8b3fc6e3108ab72b42f3ebf1b5c1c22c50f6c7025
|