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.2.tar.gz (29.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkmqr-0.6.2-py3-none-any.whl (35.4 kB view details)

Uploaded Python 3

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

Hashes for mkmqr-0.6.2.tar.gz
Algorithm Hash digest
SHA256 9a99cf3366f6b3ccd5ffde378c90ba79c0b5c5c134337259288f2af4180cb13f
MD5 21997608bf758f3e1afd6972c4b2b383
BLAKE2b-256 c845f5616db8e702d77983255454fb069c07791cf50f3aca9ea463fcfda9a2ba

See more details on using hashes here.

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

Hashes for mkmqr-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d83a76e204c2938dd9f1326fac8a9a8d163e324df55cd8f10e7ec678c90f1f60
MD5 e4f8beec1a31bae81d63ba83df8db290
BLAKE2b-256 85124fa49d14db4ce718a0e8b3fc6e3108ab72b42f3ebf1b5c1c22c50f6c7025

See more details on using hashes here.

Supported by

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