Skip to main content

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 Symbol that encodes "12345"
python -m mkmqr -p kanji.png 漢字 Symbol that encodes "漢字"
python -m mkmqr -p Q.png -e q LevelQ Symbol that encodes "LevelQ"
python -m mkmqr -p github.png HTTPS://GITHUB.COM Symbol that encodes URL of GitHub

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkmqr-0.6.0.tar.gz (29.0 kB view hashes)

Uploaded Source

Built Distribution

mkmqr-0.6.0-py3-none-any.whl (35.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page