qr == .. py:module:: qr .. autoapi-nested-parse:: Minimal QR code encoder (byte mode, versions 1-4, error levels L and M). Enough for a URL like "http://192.168.188.81/" (versions 1-4 hold up to 62 bytes at level M). Follows ISO/IEC 18004 as explained in Project Nayuki's reference implementation (https://www.nayuki.io/page/qr-code- generator-library, MIT). Attributes ---------- .. autoapisummary:: qr.MAX_VERSION Functions --------- .. autoapisummary:: qr.encode Module Contents --------------- .. py:data:: MAX_VERSION :value: 4 .. py:function:: encode(text, ecl='M', mask=None) Encode `text` as a QR code. Picks the smallest version and, unless `mask` is given, the mask with the lowest penalty. :param text: Text to encode (byte mode). :param ecl: Error correction level, "L" or "M". :param mask: Mask pattern 0-7, or None to choose the best. :returns: A list of rows, each a bytearray of 0/1 (1 = dark), without quiet zone. :raises ValueError: If the text does not fit into a version 4 code.