All Projects → heuer → Segno

heuer / Segno

Licence: bsd-3-clause
Python QR Code and Micro QR Code encoder

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Segno

Qr Code Scanner
📠 A simple, fast and useful progressive web application
Stars: ✭ 982 (+581.94%)
Mutual labels:  qr-code, qrcode, barcode
python
Build Python extension with Dynamsoft Barcode Reader.
Stars: ✭ 35 (-75.69%)
Mutual labels:  qrcode, barcode, qr-code
Barcode
barcode.php - Generate barcodes from a single PHP file. MIT license.
Stars: ✭ 141 (-2.08%)
Mutual labels:  qr-code, qrcode, barcode
Zxinglite
🔥 ZXing的精简版,优化扫码和生成二维码/条形码,内置闪光灯等功能。扫描风格支持:微信的线条样式,支付宝的网格样式。几句代码轻松拥有扫码功能 ,ZXingLite让集成更简单。(扫码识别速度快如微信)
Stars: ✭ 2,117 (+1370.14%)
Mutual labels:  qr-code, qrcode, barcode
Scanbot Sdk Example Android
Document scanning SDK example apps for the Scanbot SDK for Android.
Stars: ✭ 67 (-53.47%)
Mutual labels:  qr-code, barcode
Scannermapp
A QR-code and barcode acanner app built in Delphi using ZXing and TFrameStand
Stars: ✭ 65 (-54.86%)
Mutual labels:  qrcode, barcode
Sgqrcode
The easy to use bar code and QR code scan library for iOS【支持二维码生成、从相册中读取二维码、条形码和二维码扫描】
Stars: ✭ 1,571 (+990.97%)
Mutual labels:  qrcode, barcode
Awesome Qr.js
An awesome QR code generator written in JavaScript.
Stars: ✭ 1,247 (+765.97%)
Mutual labels:  qr-code, qrcode
Symbology
🔖 Node.js module that generates 1D and 2D barcodes in png, eps, and svg formats. Supports over 50 symbologies.
Stars: ✭ 62 (-56.94%)
Mutual labels:  qrcode, barcode
Vue Qrcode Reader
A set of Vue.js components for detecting and decoding QR codes.
Stars: ✭ 1,240 (+761.11%)
Mutual labels:  qr-code, qrcode
Zzyqrcodeswift
a scanner for QRCode barCode 最好用的ios二维码、条形码,扫描、生成框架,支持闪光灯,从相册获取,扫描音效等,高仿微信,微博
Stars: ✭ 97 (-32.64%)
Mutual labels:  qrcode, barcode
Zzyqrcode
a scanner for QRCode barCode 最好用的ios二维码、条形码,扫描、生成框架,支持闪光灯,从相册获取,扫描音效等,高仿微信,微博
Stars: ✭ 123 (-14.58%)
Mutual labels:  qrcode, barcode
Qr Ascii
A small library to generate QR codes with ascii
Stars: ✭ 63 (-56.25%)
Mutual labels:  qr-code, qrcode
Qr Code With Logo
带头像(logo)的二维码(qrcode)生成工具,无jQuery依赖,自由调整大小
Stars: ✭ 104 (-27.78%)
Mutual labels:  qr-code, qrcode
Blabel
🏷 Python label/sticker PDF generation. HTML templates, built-in barcodes, qr codes, and other goodies
Stars: ✭ 63 (-56.25%)
Mutual labels:  qrcode, barcode
Barcodescanner.xf
Barcode Scanner using GoogleVision API for Xamarin Form
Stars: ✭ 82 (-43.06%)
Mutual labels:  qrcode, barcode
Qrbtf
An art QR code (qrcode) beautifier. 艺术二维码生成器。https://qrbtf.com
Stars: ✭ 1,391 (+865.97%)
Mutual labels:  qr-code, qrcode
React Qr Svg
React component for rendering SVG QR codes
Stars: ✭ 134 (-6.94%)
Mutual labels:  qr-code, qrcode
Ngx Kjua
Angular QR-Code generator component using kjua.
Stars: ✭ 51 (-64.58%)
Mutual labels:  qr-code, qrcode
Qrcode
💮 amazing QRCode generator in Python (supporting animated gif) - Python amazing 二维码生成器(支持 gif 动态图片二维码)
Stars: ✭ 8,613 (+5881.25%)
Mutual labels:  qrcode, qr-code

.. image:: https://travis-ci.com/heuer/segno.svg?branch=master :target: https://travis-ci.com/heuer/segno

QR Code encoder and Micro QR Code encoder

Pure Python QR Code generator with no dependencies.

This package implements ISO/IEC 18004:2015(E) "QR Code bar code symbology specification" and produces QR Codes and Micro QR Codes with nearly no effort. It supports the Structured Append mode <https://segno.readthedocs.io/en/stable/structured-append.html>_ which splits a message across several QR codes.

Segno (Italian for "sign" / "symbol") provides several serialization formats like Scalable Vector Graphics (SVG), Encapsulated PostScript (EPS), Portable Network Graphics (PNG), Portable Document Format (PDF), Netpbm (PAM, PBM, PPM), LaTeX (PGF/TikZ), X PixMap (XBM), and X Bitmap (XPM) etc. None of these serializers require an external lib. Further, it provides several high level functions to create QR Codes which encode contact data (vCard, MeCard) <https://segno.readthedocs.io/en/stable/contact-information.html>, EPC QR Codes <https://segno.readthedocs.io/en/stable/epc-qrcodes.html>, or WIFI QR Codes <https://segno.readthedocs.io/en/stable/special-qrcode-factories.html#create-a-qr-code-for-a-wifi-configuration>_.

The project provides more than 1500 test cases (coverage >= 98%) to verify a standard conform QR Code and Micro QR Code generation acc. to ISO/IEC 18004:2015(E).

Unique features

  • Pure Python QR Code generator (supports 2.7, 3.5+, PyPy2 and PyPy3)
  • No dependencies
  • A lot of serialization formats <https://segno.readthedocs.io/en/stable/serializers.html#available-serializers>_ (SVG, PNG, EPS, PDF, ...)
  • Fastest (pure Python) QR Code encoder <https://segno.readthedocs.io/en/stable/comparison-qrcode-libs.html#performance>_
  • Micro QR Codes
  • Structured Append mode <https://segno.readthedocs.io/en/stable/structured-append.html>_
  • Hanzi mode <https://segno.readthedocs.io/en/stable/qrcode-modes.html#hanzi-mode>_
  • Command line interface <https://segno.readthedocs.io/en/stable/command-line.html>_
  • Simple, user-friendly API <https://segno.readthedocs.io/en/stable/make.html>_

.. code-block:: python

import segno
qr = segno.make('Yellow Submarine')
qr.save('yellow-submarine.png')

Installation

Use pip to install segno from PyPI::

$ pip install segno

MacPorts ^^^^^^^^

Segno is also available at MacPorts <https://www.macports.org/>_ (project page <https://ports.macports.org/port/py-segno/>_)::

$ sudo port install py-segno

conda-forge ^^^^^^^^^^^

The library is also available at conda-forge <https://conda-forge.org/>_ (project page <https://anaconda.org/conda-forge/segno>_)::

$ conda install -c conda-forge segno

Debian 10 / Buster (backports) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

::

$ apt-get -t buster-backports install python3-segno

Debian 11 / Bullseye (testing) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

::

$ apt-get install python3-segno

Usage

Command line ^^^^^^^^^^^^

The command line script prints a QR code to the terminal::

$ segno "Comfortably Numb"

To serialize a QR code, use the "output" argument::

$ segno -o=raincoat.svg "Famous Blue Raincoat"
$ segno --scale 10 --dark darkblue --border 0 --output=fire.svg "Who by Fire"
$ segno --scale 10 --light transparent --output=miracle.png "Waiting for the Miracle"

Library ^^^^^^^

.. code-block:: python

>>> import segno
>>> # Let Segno choose the minimal version and an optimal (maximal) error
>>> # level without changing the minimal version
>>> qr = segno.make('Up Jumped the Devil')
>>> qr.designator  # Returns the QR code version and the error correction level
'2-Q'
>>> qr.save('up-jumped-the-devil.png')  # Save as PNG
>>> qr.save('up-jumped-the-devil-2.png', scale=10)  # Scaling factor 10
>>> qr.save('up-jumped-the-devil-3.png', light=None)  # Transparent light modules
>>> qr.save('up-jumped-the-devil.pdf', scale=10)  # Save as PDF
>>> # SVG drawing the dark modules in "dark blue"
>>> qr.save('up-jumped-the-devil.svg', scale=10, dark='darkblue')

If the content to encode is small enough, a Micro QR code is generated:

.. code-block:: python

>>> import segno
>>> qr = segno.make('RAIN')
>>> qr.is_micro
True
>>> qr.designator
'M2-M'

If this behaviour is not desired, the user may set micro to False

.. code-block:: python

>>> import segno
>>> qr = segno.make('RAIN', micro=False)
>>> qr.is_micro
False
>>> qr.designator
'1-H'

Or use the factory functions segno.make_qr() which generates always QR codes (never Micro QR codes) or segno.make_micro() which returns always Micro QR codes (or raises an error if the content is too large for a Micro QR code).

.. code-block:: python

>>> import segno
>>> mqr = segno.make_micro('THE BEATLES')
>>> mqr.designator
'M3-M'
>>> qr = segno.make_qr('THE BEATLES')  # Same content but enforce a QR Code
>>> qr.designator
'1-Q'
>>> # This won't work since the data does not fit into a Micro QR Code M1 - M4
>>> mqr = segno.make_micro('Nick Cave and the Bad Seeds')
Traceback (most recent call last):
    ...
DataOverflowError: Data too large. No Micro QR Code can handle the provided data

All factory functions use the same parameters to specify the desired error level, version, data mask etc., see Segno's documentation_ for details.

Documentation

Read the online documentation at https://segno.readthedocs.io/

Trademark

"QR Code" and "Micro QR Code" are registered trademarks of DENSO WAVE INCORPORATED.

.. _Segno's documentation: https://segno.readthedocs.io/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].