Segno Documentation
Total Page:16
File Type:pdf, Size:1020Kb
Segno Documentation Author Aug 05, 2020 CONTENTS 1 QR Code creation from the command line3 1.1 Usage...................................................3 1.2 Version..................................................5 1.3 Error correction level...........................................7 1.4 QR Code serialization..........................................7 1.5 Scaling QR Codes............................................8 1.6 Changing the size of the quiet zone...................................9 1.7 Colors.................................................. 10 1.8 Structured Append............................................ 11 2 Creating QR Codes or Micro QR Codes 15 2.1 Version.................................................. 17 2.2 Error Correction Level.......................................... 18 2.3 Data Masking............................................... 19 2.3.1 Micro QR Code with different data masks........................... 19 2.3.2 QR Code with different data masks............................... 20 3 QR Code Encodings 23 3.1 Numeric Mode.............................................. 23 3.2 Alphanumeric Mode........................................... 24 3.3 Kanji Mode................................................ 25 3.4 Byte Mode................................................ 26 3.5 Hanzi Mode............................................... 26 4 Structured Append 29 4.1 Structured Append by QR Code version................................. 29 4.2 Structured Append by number of symbols................................ 30 5 Boost Error Correction Level 31 5.1 Examples................................................. 31 6 QR Code and Micro QR Code serialization 33 6.1 Border.................................................. 33 6.2 Scale................................................... 34 6.3 Color of dark and light modules..................................... 36 6.4 Saving QR Codes to streams....................................... 37 6.5 More colorful QR Codes......................................... 38 6.6 Available serializers........................................... 38 7 Colorful QR Codes 41 7.1 Module names.............................................. 42 i 7.1.1 dark / --dark ......................................... 42 7.1.2 light / --light ........................................ 43 7.1.3 alignment_dark / --align-dark .............................. 43 7.1.4 alignment_light / --align-light ............................. 44 7.1.5 dark_module / --dark-module ............................... 44 7.1.6 data_dark / --data-dark .................................. 45 7.1.7 data_light / --data-light ................................. 46 7.1.8 finder_dark / --finder-dark ................................ 47 7.1.9 finder_light / --finder-light ............................... 47 7.1.10 format_dark / --format-dark ............................... 48 7.1.11 format_light / --format-light .............................. 49 7.1.12 quiet_zone / --quiet-zone ................................. 49 7.1.13 separator / --separator ................................... 50 7.1.14 timing_dark / --timing-dark ............................... 51 7.1.15 timing_light / --timing-light ............................... 51 7.1.16 version_dark / --version-dark .............................. 52 7.1.17 version_light / --version-light ............................. 52 8 SVG Options 55 8.1 Options.................................................. 55 8.1.1 xmldecl............................................. 55 8.1.2 svgns.............................................. 55 8.1.3 svgid / --svgid ........................................ 55 8.1.4 svgclass / --svgclass .................................... 55 8.1.5 lineclass / --lineclass ................................... 55 8.1.6 omitsize / --no-size ..................................... 55 8.1.7 nl................................................ 56 8.1.8 title / --title ......................................... 56 8.1.9 desc / --desc ......................................... 56 8.1.10 unit / --unit ......................................... 56 8.1.11 encoding / --encoding ................................... 56 8.1.12 draw_transparent........................................ 56 8.1.13 svgversion / --svgversion ................................. 56 8.2 Optimizing SVG............................................. 57 9 Special QR Code factory functions 61 9.1 Create a QR Code for a WIFI configuration............................... 61 9.2 Create a QR Code encoding geographic information.......................... 62 10 Creating a QR Code encoding contact information 65 10.1 MeCard.................................................. 65 10.2 vCard................................................... 65 11 EPC QR Codes 67 12 Comparison of Python QR Code libraries 69 12.1 Features.................................................. 69 12.2 Performance............................................... 71 12.2.1 Create a 1-M QR Code..................................... 71 12.2.2 Create a 7-Q QR Code..................................... 71 12.2.3 Create a 30-H QR Code..................................... 71 12.2.4 Create a QR Code and serialize it as SVG........................... 71 12.2.5 Create a QR Code and serialize it as PNG........................... 72 13 Man Pages 73 ii 13.1 segno................................................... 73 13.1.1 Synopsis............................................. 73 13.1.2 Description........................................... 73 13.1.3 Command Line Options.................................... 73 13.1.3.1 QR Code Options................................... 73 13.1.3.2 Output Options.................................... 74 13.1.3.3 Module Colors..................................... 74 13.1.3.4 SVG Options..................................... 75 13.1.3.5 PNG Options..................................... 76 13.1.4 Exit Status............................................ 76 13.1.5 Examples............................................ 76 14 Writing plugins for Segno 77 14.1 Simple plugin............................................... 77 15 API 79 15.1 Module contents............................................. 79 15.2 High level QR Code factories...................................... 90 16 Python 2 Statement 97 17 Changes 99 17.1 1.1.0 – 2020-08-05............................................ 99 17.2 1.0.2 – 2020-07-30............................................ 99 17.3 1.0.1 – 2020-07-28............................................ 99 17.4 1.0.0 – 2020-02-14............................................ 100 17.5 0.4.0 – 2020-01-21............................................ 100 17.6 0.3.9 – 2020-01-19............................................ 100 17.7 0.3.8 – 2020-01-15............................................ 100 17.8 0.3.7 – 2020-01-09............................................ 101 17.9 0.3.6 – 2020-01-06............................................ 101 17.10 0.3.5 – 2020-01-03............................................ 102 17.11 0.3.4 – 2020-01-02............................................ 102 17.12 0.3.3 – 2019-12-29............................................ 102 17.13 0.3.2 – 2019-07-15............................................ 103 17.14 0.3.1 – 2019-07-15............................................ 103 17.15 0.3.0 – 2019-06-25............................................ 103 17.16 0.2.9 – 2019-04-24............................................ 103 17.17 0.2.8 – 2018-10-17............................................ 103 17.18 0.2.7 – 2018-02-18............................................ 104 17.19 0.2.6 – 2018-02-18............................................ 104 17.20 0.2.5 – 2017-02-14............................................ 104 17.21 0.2.4 – 2017-01-31............................................ 104 17.22 0.2.3 – 2016-10-17............................................ 105 17.23 0.2.2 – 2016-09-21............................................ 105 17.24 0.2.1 – 2016-09-15............................................ 105 17.25 0.2.0 – 2016-09-15............................................ 105 17.26 0.1.9 – 2016-09-15............................................ 105 17.27 0.1.8 – 2016-09-14............................................ 106 17.28 0.1.7 – 2016-09-04............................................ 106 17.29 0.1.6 – 2016-08-25............................................ 106 17.30 0.1.5 – 2016-08-24............................................ 106 17.31 0.1.4 – 2016-08-21............................................ 107 17.32 0.1.3 – 2016-08-20............................................ 107 17.33 0.1.2 – 2016-08-17............................................ 107 iii 17.34 0.1.1 – 2016-08-14............................................ 107 18 Indices and tables 109 Python Module Index 111 Index 113 iv Segno Documentation Segno (Italian for “sign” / “symbol”) generates QR Codes and Micro QR Codes according to ISO/IEC 18004:2015(E). Aside from other Python QR Code generators, Segno provides a lot of output formats without 3rd party dependencies and is very simple to use. Contents: CONTENTS 1 Segno Documentation 2 CONTENTS CHAPTER ONE QR CODE CREATION FROM THE COMMAND LINE The command line script segno can be used to print QR codes to the terminal or to save them in supported formats like SVG, PNG, EPS, . By default, the script does not create Micro QR codes, use --micro to allow the creation of Micro QR codes or specify the version (like --version=M3) to create a Micro QR Code. See the CLI man page