Skip to main content

A QR code generator written purely in python 3 with SVG and PNG output.

Project description

The pyqrcode module is a QR code generator that is simple to use and written in pure python 3. The module automates most of the building process for you. Generally, QR codes can be created using only two lines of code!

Unlike other generators, all of the automation can be controlled manually. You are free to set any or all of the properties of your QR code.

QR codes can be saved as SVG, PNG (by using the pypng module), and plain text. PIL is not used to render the image files.

The pyqrcode module attempts to follow the QR code standard as closely as possible. The terminology and the encodings used in pyqrcode come directly from the standard. This module also follows the algorithm laid out in the standard.

Homepage: https://github.com/mnooner256/pyqrcode

Documentation: http://pythonhosted.org/PyQRCode/

Requirements

The pyqrcode module only requires Python 3. You may want to install pypng in order to render PNG files, but it is optional. Note, pypng is a pure python PNG writer which does not require any other libraries.

Installation

Installation is simple. It can be installed from pip using the following command:

$ pip install pyqrcode

or from the code:

$ python setup.py install

Usage

The pyqrcode module aims to be as simple to use as possible. Below is a simple example of creating a QR code for a URL. The code is rendered out as an svg file.

>>> import pyqrcode
>>> url = pyqrcode.create('http://uca.edu')
>>> url.svg('uca-url.svg', scale=8)

The pyqrcode module, while easy to use, is powerful. You can set every property of the QR code. If you install the optional pypng module, you can render the code as a PNG image. Below is a more complex example:

>>> big_code = pyqrcode.create('0987654321', error='L', version=27, mode='binary')
>>> big_code.png('code.png', scale=6, module_color=[0, 0, 0, 128], background=[0xff, 0xff, 0xcc])

Project details


Download files

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

Source Distributions

PyQRCode-0.10.1.zip (30.8 kB view details)

Uploaded Source

PyQRCode-0.10.1.tar.gz (26.2 kB view details)

Uploaded Source

File details

Details for the file PyQRCode-0.10.1.zip.

File metadata

  • Download URL: PyQRCode-0.10.1.zip
  • Upload date:
  • Size: 30.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyQRCode-0.10.1.zip
Algorithm Hash digest
SHA256 77770a5ff5579c1d7c39cc19bcf7d304fc1a7de21a41c8012ea1842fbfc37ee9
MD5 6a84b7fc09e59f57139a3f01e0aaa211
BLAKE2b-256 9c199df862f561fd84128570d20eecac50f8a30cccb7d2737fd0cb5db00ba89c

See more details on using hashes here.

File details

Details for the file PyQRCode-0.10.1.tar.gz.

File metadata

  • Download URL: PyQRCode-0.10.1.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyQRCode-0.10.1.tar.gz
Algorithm Hash digest
SHA256 687d6c1e9e95abd61972b24662953176622c3af49e8f6db5f0ec4188d37bf412
MD5 4f88361a2177e4a1b689ba34523e0874
BLAKE2b-256 88d79eeb1aa65eb3e51caed1997e2522b4df40f521b64363d8c86a1b3362e5a6

See more details on using hashes here.

Supported by

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