segno


Namesegno JSON
Version 1.6.1 PyPI version JSON
download
home_page
SummaryQR Code and Micro QR Code generator for Python
upload_time2024-02-08 22:41:12
maintainer
docs_urlNone
author
requires_python>=3.5
license
keywords qr code micro qr code iso/iec 18004 iso/iec 18004:2006(e) iso/iec 18004:2015(e) qrcode qr barcode matrix 2d
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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 
* 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
    qrcode = segno.make('Yellow Submarine')
    qrcode.save('yellow-submarine.png')

* `Colorful QR codes <https://segno.readthedocs.io/en/stable/colorful-qrcodes.html>`_

  .. image:: https://github.com/heuer/segno/raw/master/docs/_static/colorful/qrcode_yellow-submarine.png
    :alt: Colorful 7-H QR code encoding "Yellow Submarine"

  ... works also with Micro QR codes

  .. image:: https://github.com/heuer/segno/raw/master/docs/_static/colorful/micro_qrcode_rain.png
    :alt: Colorful M4-Q Micro QR code encoding "Rain"

* `Artistic QR Codes <https://segno.readthedocs.io/en/stable/artistic-qrcodes.html>`_
  (requires the `qrcode-artistic <https://github.com/heuer/qrcode-artistic>`_ plug-in)

  .. image:: https://github.com/heuer/segno/raw/master/docs/_static/artistic/letitbe.jpg
    :alt: Animated 3-H QR code encoding "The Beatles -- Let It Be"

  ... animated QR codes are supported as well

  .. image:: https://github.com/heuer/segno/raw/master/docs/_static/artistic/abbey-road.webp
    :alt: Animated 4-H QR code encoding "The Beatles -- Abbey Road"


Installation
------------

Use ``pip`` to install segno from PyPI::

    $ pip install segno


MacPorts
^^^^^^^^

Segno is also available at `MacPorts <https://www.macports.org/>`_
(`MacPorts 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/>`_
(`conda-forge project page <https://anaconda.org/conda-forge/segno>`_)::

    $ conda install -c conda-forge segno


Debian
^^^^^^

::

    $ apt-get install python3-segno


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

::

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


Arch Linux
^^^^^^^^^^

::

    $ pacman -S python-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
    >>> qrcode = segno.make('Up Jumped the Devil')
    >>> qrcode.designator  # Returns the QR code version and the error correction level
    '2-Q'
    >>> qrcode.save('up-jumped-the-devil.png')  # Save as PNG
    >>> qrcode.save('up-jumped-the-devil-2.png', scale=10)  # Scaling factor 10
    >>> qrcode.save('up-jumped-the-devil-3.png', light=None)  # Transparent light modules
    >>> qrcode.save('up-jumped-the-devil.pdf', scale=10)  # Save as PDF
    >>> # SVG drawing the dark modules in "dark blue"
    >>> qrcode.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
    >>> qrcode = segno.make('RAIN')
    >>> qrcode.is_micro
    True
    >>> qrcode.designator
    'M2-M'


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

.. code-block:: python

    >>> import segno
    >>> qrcode = segno.make('RAIN', micro=False)
    >>> qrcode.is_micro
    False
    >>> qrcode.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
    >>> qrcode_micro = segno.make_micro('THE BEATLES')
    >>> qrcode_micro.designator
    'M3-M'
    >>> qrcode = segno.make_qr('THE BEATLES')  # Same content but enforce a QR Code
    >>> qrcode.designator
    '1-Q'
    >>> # This won't work since the data does not fit into a Micro QR Code M1 - M4
    >>> micro_qrcode = 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/


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "segno",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "",
    "keywords": "QR Code,Micro QR Code,ISO/IEC 18004,ISO/IEC 18004:2006(E),ISO/IEC 18004:2015(E),qrcode,QR,barcode,matrix,2D",
    "author": "",
    "author_email": "Lars Heuer <heuer@semagia.com>",
    "download_url": "https://files.pythonhosted.org/packages/5d/74/3896e205306a1b43d6b88326e5838572d97b4b74df8c9cd11acfcd9db503/segno-1.6.1.tar.gz",
    "platform": null,
    "description": "QR Code encoder and Micro QR Code encoder\n=========================================\n\nPure Python QR Code generator with no dependencies.\n\nThis package implements ISO/IEC 18004:2015(E) \"QR Code bar code symbology\nspecification\" and produces QR Codes and Micro QR Codes with nearly no effort.\nIt supports the `Structured Append mode <https://segno.readthedocs.io/en/stable/structured-append.html>`_\nwhich splits a message across several QR codes.\n\nSegno (Italian for \"sign\" / \"symbol\") provides several serialization formats\nlike Scalable Vector Graphics (SVG), Encapsulated PostScript (EPS),\nPortable Network Graphics (PNG), Portable Document Format (PDF), Netpbm (PAM, PBM, PPM),\nLaTeX (PGF/TikZ), X PixMap (XBM), and X Bitmap (XPM) etc.\nNone of these serializers require an external lib.\nFurther, it provides several high level functions to create QR Codes which encode\n`contact data (vCard, MeCard) <https://segno.readthedocs.io/en/stable/contact-information.html>`_,\n`EPC QR Codes <https://segno.readthedocs.io/en/stable/epc-qrcodes.html>`_,\nor `WIFI QR Codes <https://segno.readthedocs.io/en/stable/special-qrcode-factories.html#create-a-qr-code-for-a-wifi-configuration>`_.\n\nThe project provides more than 1500 test cases (coverage >= 98%) to verify a\nstandard conform QR Code and Micro QR Code generation acc. to ISO/IEC 18004:2015(E).\n\n\nUnique features\n---------------\n* Pure Python QR Code generator \n* No dependencies\n* A lot of `serialization formats <https://segno.readthedocs.io/en/stable/serializers.html#available-serializers>`_ (SVG, PNG, EPS, PDF, ...)\n* `Fastest (pure Python) QR Code encoder <https://segno.readthedocs.io/en/stable/comparison-qrcode-libs.html#performance>`_\n* Micro QR Codes\n* `Structured Append mode <https://segno.readthedocs.io/en/stable/structured-append.html>`_\n* `Hanzi mode <https://segno.readthedocs.io/en/stable/qrcode-modes.html#hanzi-mode>`_\n* `Command line interface <https://segno.readthedocs.io/en/stable/command-line.html>`_\n* `Simple, user-friendly API <https://segno.readthedocs.io/en/stable/make.html>`_\n\n.. code-block:: python\n\n    import segno\n    qrcode = segno.make('Yellow Submarine')\n    qrcode.save('yellow-submarine.png')\n\n* `Colorful QR codes <https://segno.readthedocs.io/en/stable/colorful-qrcodes.html>`_\n\n  .. image:: https://github.com/heuer/segno/raw/master/docs/_static/colorful/qrcode_yellow-submarine.png\n    :alt: Colorful 7-H QR code encoding \"Yellow Submarine\"\n\n  ... works also with Micro QR codes\n\n  .. image:: https://github.com/heuer/segno/raw/master/docs/_static/colorful/micro_qrcode_rain.png\n    :alt: Colorful M4-Q Micro QR code encoding \"Rain\"\n\n* `Artistic QR Codes <https://segno.readthedocs.io/en/stable/artistic-qrcodes.html>`_\n  (requires the `qrcode-artistic <https://github.com/heuer/qrcode-artistic>`_ plug-in)\n\n  .. image:: https://github.com/heuer/segno/raw/master/docs/_static/artistic/letitbe.jpg\n    :alt: Animated 3-H QR code encoding \"The Beatles -- Let It Be\"\n\n  ... animated QR codes are supported as well\n\n  .. image:: https://github.com/heuer/segno/raw/master/docs/_static/artistic/abbey-road.webp\n    :alt: Animated 4-H QR code encoding \"The Beatles -- Abbey Road\"\n\n\nInstallation\n------------\n\nUse ``pip`` to install segno from PyPI::\n\n    $ pip install segno\n\n\nMacPorts\n^^^^^^^^\n\nSegno is also available at `MacPorts <https://www.macports.org/>`_\n(`MacPorts project page <https://ports.macports.org/port/py-segno/>`_)::\n\n    $ sudo port install py-segno\n\n\nconda-forge\n^^^^^^^^^^^\n\nThe library is also available at `conda-forge <https://conda-forge.org/>`_\n(`conda-forge project page <https://anaconda.org/conda-forge/segno>`_)::\n\n    $ conda install -c conda-forge segno\n\n\nDebian\n^^^^^^\n\n::\n\n    $ apt-get install python3-segno\n\n\nDebian 10 / Buster (backports)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n::\n\n    $ apt-get -t buster-backports install python3-segno\n\n\nArch Linux\n^^^^^^^^^^\n\n::\n\n    $ pacman -S python-segno\n\n\n\nUsage\n-----\n\nCommand line\n^^^^^^^^^^^^\n\nThe command line script prints a QR code to the terminal::\n\n    $ segno \"Comfortably Numb\"\n\n\nTo serialize a QR code, use the \"output\" argument::\n\n    $ segno -o=raincoat.svg \"Famous Blue Raincoat\"\n    $ segno --scale 10 --dark darkblue --border 0 --output=fire.svg \"Who by Fire\"\n    $ segno --scale 10 --light transparent --output=miracle.png \"Waiting for the Miracle\"\n\n\n\nLibrary\n^^^^^^^\n\n.. code-block:: python\n\n    >>> import segno\n    >>> # Let Segno choose the minimal version and an optimal (maximal) error\n    >>> # level without changing the minimal version\n    >>> qrcode = segno.make('Up Jumped the Devil')\n    >>> qrcode.designator  # Returns the QR code version and the error correction level\n    '2-Q'\n    >>> qrcode.save('up-jumped-the-devil.png')  # Save as PNG\n    >>> qrcode.save('up-jumped-the-devil-2.png', scale=10)  # Scaling factor 10\n    >>> qrcode.save('up-jumped-the-devil-3.png', light=None)  # Transparent light modules\n    >>> qrcode.save('up-jumped-the-devil.pdf', scale=10)  # Save as PDF\n    >>> # SVG drawing the dark modules in \"dark blue\"\n    >>> qrcode.save('up-jumped-the-devil.svg', scale=10, dark='darkblue')\n\n\nIf the content to encode is small enough, a Micro QR code is generated:\n\n.. code-block:: python\n\n    >>> import segno\n    >>> qrcode = segno.make('RAIN')\n    >>> qrcode.is_micro\n    True\n    >>> qrcode.designator\n    'M2-M'\n\n\nIf this behaviour is not desired, the user may set ``micro`` to ``False``\n\n.. code-block:: python\n\n    >>> import segno\n    >>> qrcode = segno.make('RAIN', micro=False)\n    >>> qrcode.is_micro\n    False\n    >>> qrcode.designator\n    '1-H'\n\n\nOr use the factory functions ``segno.make_qr()`` which generates always QR codes\n(never Micro QR codes) or ``segno.make_micro()`` which returns always\nMicro QR codes (or raises an error if the content is too large for a Micro QR code).\n\n.. code-block:: python\n\n    >>> import segno\n    >>> qrcode_micro = segno.make_micro('THE BEATLES')\n    >>> qrcode_micro.designator\n    'M3-M'\n    >>> qrcode = segno.make_qr('THE BEATLES')  # Same content but enforce a QR Code\n    >>> qrcode.designator\n    '1-Q'\n    >>> # This won't work since the data does not fit into a Micro QR Code M1 - M4\n    >>> micro_qrcode = segno.make_micro('Nick Cave and the Bad Seeds')\n    Traceback (most recent call last):\n        ...\n    DataOverflowError: Data too large. No Micro QR Code can handle the provided data\n\n\nAll factory functions use the same parameters to specify the desired error\nlevel, version, data mask etc., see `Segno's documentation`_ for details.\n\n\nDocumentation\n-------------\nRead the online documentation at <https://segno.readthedocs.io/>\n\n\nTrademark\n---------\n\"QR Code\" and \"Micro QR Code\" are registered trademarks of DENSO WAVE INCORPORATED.\n\n\n.. _Segno's documentation: https://segno.readthedocs.io/\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "QR Code and Micro QR Code generator for Python",
    "version": "1.6.1",
    "project_urls": {
        "Changes": "https://github.com/heuer/segno/blob/master/CHANGES.rst",
        "Documentation": "https://segno.readthedocs.io/",
        "Homepage": "https://github.com/heuer/segno/",
        "Issue tracker": "https://github.com/heuer/segno/issues/"
    },
    "split_keywords": [
        "qr code",
        "micro qr code",
        "iso/iec 18004",
        "iso/iec 18004:2006(e)",
        "iso/iec 18004:2015(e)",
        "qrcode",
        "qr",
        "barcode",
        "matrix",
        "2d"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "277cabc460494640767edfce9c920da3e03df22327fc5e3d51c7857f50fd89c4",
                "md5": "e2a68bff3cf5f577b2007dc8ccdee630",
                "sha256": "e90c6ff82c633f757a96d4b1fb06cc932589b5237f33be653f52252544ac64df"
            },
            "downloads": -1,
            "filename": "segno-1.6.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e2a68bff3cf5f577b2007dc8ccdee630",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 73927,
            "upload_time": "2024-02-08T22:41:09",
            "upload_time_iso_8601": "2024-02-08T22:41:09.679014Z",
            "url": "https://files.pythonhosted.org/packages/27/7c/abc460494640767edfce9c920da3e03df22327fc5e3d51c7857f50fd89c4/segno-1.6.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5d743896e205306a1b43d6b88326e5838572d97b4b74df8c9cd11acfcd9db503",
                "md5": "3835036bcf44667eb0a155107ed1ac67",
                "sha256": "f23da78b059251c36e210d0cf5bfb1a9ec1604ae6e9f3d42f9a7c16d306d847e"
            },
            "downloads": -1,
            "filename": "segno-1.6.1.tar.gz",
            "has_sig": false,
            "md5_digest": "3835036bcf44667eb0a155107ed1ac67",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 72531,
            "upload_time": "2024-02-08T22:41:12",
            "upload_time_iso_8601": "2024-02-08T22:41:12.544746Z",
            "url": "https://files.pythonhosted.org/packages/5d/74/3896e205306a1b43d6b88326e5838572d97b4b74df8c9cd11acfcd9db503/segno-1.6.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-08 22:41:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "heuer",
    "github_project": "segno",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "segno"
}
        
Elapsed time: 0.19033s