Skip to main content

Convert Segno's (Micro) QR Codes into more advanced SVG documents

Project description

Segno Quark: Plugin for creating more advanced SVG documents

This (experimental) Segno plugin changes the default SVG output in different ways (i.e. applying SVG filters).

Tested under PyPy, Python 2.7 and Python 3.4. Unlike Segno itself, this package does not work with Python 2.6.

Installation

Use pip to install this quark from PyPI:

$ pip install segno

Usage

One installed, the quark is automatically detected as Segno plugin and therefore available via qrcode.to_XXX(...).

Available converters

All converters use the same keyword parameters as Segno’s SVG serializer, see segno.QRCode.save() for details.

ETree

Creates a SVG QR Code and returns the SVG document as xml.etree.ElementTree.

Usage: to_etree

This converter provides no additional keyword arguments.

Pacman

Creates a QR Code with a smiley (and optional ghosts).

Usage: to_pacman

Keyword

Description

pacman_color

Color of the smiley, default: #fc0

dot_color

Color of the dots which the smiley should eat, default: #fc0

ghosts

Number of ghosts, default: 5. If set to 0, no ghost appears. Note: Setting this a very high value may cause an infinite loop iff number of ghosts > number of available dark modules. Additionally, the QR Code may not be readable by common QR Code decoders. The positions of the ghosts are choosen at random.

ghost_colors

A tuple of colors which the ghosts may get. Default: ('#ff0c13', '#f2aeaf', '#1bb1e6', '#f97e16') Not all colors may be used, the colors for the ghosts are choosen at random.

Example:

>>> import segno
>>> qr = segno.make_qr('Ob-La-Di, Ob-La-Da')
>>> qr.to_pacman('obladioblada.svg', scale=10, ghosts=7)

Result:

Example of to_pacman result

Glow

Creates a QR Code with a “glow” effect.

Usage: to_glow

Keyword

Description

filter_id

Indicates the id of the filter, default: segno-glow

deviation

Indicates the standard deviation for the blur operation, default: .6

Example:

>>> import segno
>>> qr = segno.make_qr('Ob-La-Di, Ob-La-Da')
>>> qr.to_glow('obladioblada.svg', scale=10, color='darkblue')

Result:

Example of to_glow result

Blur

Creates a QR Code with a “blur” effect.

Usage: to_blur

Keyword

Description

filter_id

Indicates the id of the filter, default: segno-blur

deviation

Indicates the standard deviation for the blur operation, default: .3

Example:

>>> import segno
>>> qr = segno.make_qr('Ob-La-Di, Ob-La-Da')
>>> qr.to_blur('obladioblada.svg', scale=10, color='darkred')

Result:

Example of to_blur result

Changes

0.1.0 – 2016-08-18

  • Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

segno-quark-0.1.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

segno_quark-0.1.0-py2.py3-none-any.whl (8.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file segno-quark-0.1.0.tar.gz.

File metadata

  • Download URL: segno-quark-0.1.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for segno-quark-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e6db100a0972c70c0829436f00ced0e1208f061456ce38889fa942a86dcea167
MD5 f937ec63da744e8a8efcf33dd8aa3990
BLAKE2b-256 36806451f5a75845451901ced164f56212de7f31d00cadbf2085b21c8c000a71

See more details on using hashes here.

File details

Details for the file segno_quark-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for segno_quark-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 29b21fa9f8cd5af39dae95b64eb7c8246b1b78906f71e484b0eec0e4e4b9543b
MD5 7523a54cc28a104ba5aad8670c24ca81
BLAKE2b-256 e0e11ece5b155b282d972f6b37cbb4530a115a1c98dafe90d93dfd27b25faf3e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page