15317bbafSopenharmony_ci# 25317bbafSopenharmony_ci# QR Code generator Distutils script (Python) 35317bbafSopenharmony_ci# 45317bbafSopenharmony_ci# Copyright (c) Project Nayuki. (MIT License) 55317bbafSopenharmony_ci# https://www.nayuki.io/page/qr-code-generator-library 65317bbafSopenharmony_ci# 75317bbafSopenharmony_ci# Permission is hereby granted, free of charge, to any person obtaining a copy of 85317bbafSopenharmony_ci# this software and associated documentation files (the "Software"), to deal in 95317bbafSopenharmony_ci# the Software without restriction, including without limitation the rights to 105317bbafSopenharmony_ci# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 115317bbafSopenharmony_ci# the Software, and to permit persons to whom the Software is furnished to do so, 125317bbafSopenharmony_ci# subject to the following conditions: 135317bbafSopenharmony_ci# - The above copyright notice and this permission notice shall be included in 145317bbafSopenharmony_ci# all copies or substantial portions of the Software. 155317bbafSopenharmony_ci# - The Software is provided "as is", without warranty of any kind, express or 165317bbafSopenharmony_ci# implied, including but not limited to the warranties of merchantability, 175317bbafSopenharmony_ci# fitness for a particular purpose and noninfringement. In no event shall the 185317bbafSopenharmony_ci# authors or copyright holders be liable for any claim, damages or other 195317bbafSopenharmony_ci# liability, whether in an action of contract, tort or otherwise, arising from, 205317bbafSopenharmony_ci# out of or in connection with the Software or the use or other dealings in the 215317bbafSopenharmony_ci# Software. 225317bbafSopenharmony_ci# 235317bbafSopenharmony_ci 245317bbafSopenharmony_ciimport setuptools 255317bbafSopenharmony_ci 265317bbafSopenharmony_ci 275317bbafSopenharmony_cisetuptools.setup( 285317bbafSopenharmony_ci name = "qrcodegen", 295317bbafSopenharmony_ci description = "High quality QR Code generator library for Python", 305317bbafSopenharmony_ci version = "1.8.0", 315317bbafSopenharmony_ci platforms = "OS Independent", 325317bbafSopenharmony_ci python_requires = '>=3', 335317bbafSopenharmony_ci license = "MIT License", 345317bbafSopenharmony_ci 355317bbafSopenharmony_ci author = "Project Nayuki", 365317bbafSopenharmony_ci author_email = "me@nayuki.io", 375317bbafSopenharmony_ci url = "https://www.nayuki.io/page/qr-code-generator-library", 385317bbafSopenharmony_ci 395317bbafSopenharmony_ci classifiers = [ 405317bbafSopenharmony_ci "Development Status :: 5 - Production/Stable", 415317bbafSopenharmony_ci "Intended Audience :: Developers", 425317bbafSopenharmony_ci "Intended Audience :: Information Technology", 435317bbafSopenharmony_ci "License :: OSI Approved :: MIT License", 445317bbafSopenharmony_ci "Operating System :: OS Independent", 455317bbafSopenharmony_ci "Programming Language :: Python", 465317bbafSopenharmony_ci "Programming Language :: Python :: 3", 475317bbafSopenharmony_ci "Topic :: Multimedia :: Graphics", 485317bbafSopenharmony_ci "Topic :: Software Development :: Libraries :: Python Modules", 495317bbafSopenharmony_ci ], 505317bbafSopenharmony_ci 515317bbafSopenharmony_ci long_description = """========================= 525317bbafSopenharmony_ciQR Code generator library 535317bbafSopenharmony_ci========================= 545317bbafSopenharmony_ci 555317bbafSopenharmony_ci 565317bbafSopenharmony_ciIntroduction 575317bbafSopenharmony_ci------------ 585317bbafSopenharmony_ci 595317bbafSopenharmony_ciThis project aims to be the best, clearest QR Code generator library. The primary goals are flexible options and absolute correctness. Secondary goals are compact implementation size and good documentation comments. 605317bbafSopenharmony_ci 615317bbafSopenharmony_ciHome page with live JavaScript demo, extensive descriptions, and competitor comparisons: https://www.nayuki.io/page/qr-code-generator-library 625317bbafSopenharmony_ci 635317bbafSopenharmony_ci 645317bbafSopenharmony_ciFeatures 655317bbafSopenharmony_ci-------- 665317bbafSopenharmony_ci 675317bbafSopenharmony_ciCore features: 685317bbafSopenharmony_ci 695317bbafSopenharmony_ci* Significantly shorter code but more documentation comments compared to competing libraries 705317bbafSopenharmony_ci* Supports encoding all 40 versions (sizes) and all 4 error correction levels, as per the QR Code Model 2 standard 715317bbafSopenharmony_ci* Output format: Raw modules/pixels of the QR symbol 725317bbafSopenharmony_ci* Detects finder-like penalty patterns more accurately than other implementations 735317bbafSopenharmony_ci* Encodes numeric and special-alphanumeric text in less space than general text 745317bbafSopenharmony_ci* Open-source code under the permissive MIT License 755317bbafSopenharmony_ci 765317bbafSopenharmony_ciManual parameters: 775317bbafSopenharmony_ci 785317bbafSopenharmony_ci* User can specify minimum and maximum version numbers allowed, then library will automatically choose smallest version in the range that fits the data 795317bbafSopenharmony_ci* User can specify mask pattern manually, otherwise library will automatically evaluate all 8 masks and select the optimal one 805317bbafSopenharmony_ci* User can specify absolute error correction level, or allow the library to boost it if it doesn't increase the version number 815317bbafSopenharmony_ci* User can create a list of data segments manually and add ECI segments 825317bbafSopenharmony_ci 835317bbafSopenharmony_ciMore information about QR Code technology and this library's design can be found on the project home page. 845317bbafSopenharmony_ci 855317bbafSopenharmony_ci 865317bbafSopenharmony_ciExamples 875317bbafSopenharmony_ci-------- 885317bbafSopenharmony_ci 895317bbafSopenharmony_ci:: 905317bbafSopenharmony_ci 915317bbafSopenharmony_ci from qrcodegen import * 925317bbafSopenharmony_ci 935317bbafSopenharmony_ci # Simple operation 945317bbafSopenharmony_ci qr0 = QrCode.encode_text("Hello, world!", QrCode.Ecc.MEDIUM) 955317bbafSopenharmony_ci svg = to_svg_str(qr0, 4) # See qrcodegen-demo 965317bbafSopenharmony_ci 975317bbafSopenharmony_ci # Manual operation 985317bbafSopenharmony_ci segs = QrSegment.make_segments("3141592653589793238462643383") 995317bbafSopenharmony_ci qr1 = QrCode.encode_segments(segs, QrCode.Ecc.HIGH, 5, 5, 2, False) 1005317bbafSopenharmony_ci for y in range(qr1.get_size()): 1015317bbafSopenharmony_ci for x in range(qr1.get_size()): 1025317bbafSopenharmony_ci (... paint qr1.get_module(x, y) ...) 1035317bbafSopenharmony_ci 1045317bbafSopenharmony_ciMore complete set of examples: https://github.com/nayuki/QR-Code-generator/blob/master/python/qrcodegen-demo.py .""", 1055317bbafSopenharmony_ci 1065317bbafSopenharmony_ci py_modules = ["qrcodegen"], 1075317bbafSopenharmony_ci) 108