Python SDK

Supported Platforms

The Python SDK supports Python 2.7, and 3.4 - 3.7.

Getting Started

Install the SDK

pip install quikkly-python-sdk

Generating SVG codes has no extra Python dependencies. Scanning codes from images also requires installing the numpy and Pillow Python packages.

Download the Native Libraries

Contact us to obtain the C++ native libraries built for your OS, and unzip them into a folder on your server.

Create a Code --native-libs-dir <path> --type template0001style1 --data 12345 --output-file mycode.svg

Open mycode.svg in a browser to view it.

Applying Styles and Themes

Plese see the the Codes and Templates page for the possible style settings and their behaviour, and script source code for how to set them on the command line.

Note that --data-colors can be provided multiple times.

Loading Custom Blueprints

If you have a custom blueprint_xxxx.json file from us, copy it onto your server, and use the command-line options --native-libs-dir <path> --blueprint-file <path> --type templateXXXXstyle1 <rest of the options>

Note that your blueprint will contain only a few template IDs, and won’t contain the default ones like template0001style1. So make sure to select your --type templateXXXXstyle1 or similar.

Converting SVG Codes to PNG Images

The Quikkly SDK outputs generated codes as SVG vector images. These can be rendered in most web browsers, and mobile WebViews.

You can convert the SVGs to PNGs using the ImageMagick library and its convert and mogrify command-line tools.

  • On Ubuntu: apt-get install imagemagick
  • On MacOS with Homebrew: brew install --with-librsvg imagemagick
  • Then use with: convert -density 300 -background none mycode.svg mycode.png
  • To convert many files at the same time, use mogrify -format png -density 300 -background none *.svg

The -density 300 parameter controls the output resolution, and -background none ensures that the space outside of the code is transparent instead of white.

The ImageMagick documentation lists many more options, but these two are sufficient to get started.