Skip to main content

QLI File Parser and SVG Conversion Tool

Project description

QLI SVG Converter

QLI provides a simple conversion of QLI format files to SVG files. QLI also supports conversion to raster file formats supported by the ImageMagic "convert" tool.

QLI files are the predominant format for the Statler Stitcher by Gammill®. The QLI format defines a collection of stitching paths. The file format is a subset of the Galil DMC language, although, no official information from Gammill has been made available.

This is provided in an open source format in the hope that someone else may find this useful.

Feel welcome to raise issues at: https://github.com/owebeeone/qli/issues

I make no promise to look at them but I will, time permitting. However raising issues will likely get a response while emailing me directly will likely not.

Installation

Install the package using pip:

pip install qli

You will need Python 3 and the svg.path Python package installed on your computer. svg.path will be installed automatically when you install qli via pip.

Usage

To see the available options, run:

python -m qli.qli_to_svg --help

Examples

Convert a single file from QLI format to SVG:

python -m qli.qli_to_svg a-file.qli

This will create a-file.svg.

Convert an entire directory hierarchy of QLI files:

python -m qli.qli_to_svg --recursive --continue_on_error a-directory

All files named .qli will have a new file with the suffix replaced with .svg.

Remove the border on the generated files:

python -m qli.qli_to_svg --borders '' a-file.qli

Place the border on the shape extents:

python -m qli.qli_to_svg --borders 'green:0' a-file.qli

Add two borders:

python -m qli.qli_to_svg --borders 'blue:1,red:0' a-file.qli

The second border will be drawn directly on the shape extents.

Additionally convert to a PNG image:

python -m qli.qli_to_svg --raster_out png a-file.qli

The --raster_out parameter is a comma-separated list. You can specify raster types like png, jpeg, etc., supported by ImageMagick's convert tool. For advanced usage involving convert parameters, refer to the --help output.

Produce SVG with no margin or border and double wide lines:

python -m qli.qli_to_svg --margin 0x0 --borders '' --line_width 2 a-file.qli

The resulting file will have no border.

Command Line Options

usage: qli_to_svg.py [-h] [--oncolor ONCOLOR] [--offcolor OFFCOLOR] [--line_width LINE_WIDTH] [--margin MARGIN] [--width WIDTH] [--borders BORDERS]
                     [--recursive | --no-recursive] [--continue_on_error | --no-continue_on_error] [--out_dir OUT_DIR] [--out_name OUT_NAME]
                     [--suffix SUFFIX] [--print_progress | --no-print_progress] [--raster_image RASTER_IMAGE] [--raster_out RASTER_OUT]
                     [<file> ...]

Convert QLI pattern files to SVG.

positional arguments:
  <file>                input files

options:
  -h, --help            show this help message and exit
  --oncolor ONCOLOR     The color of the "on" path default: black
  --offcolor OFFCOLOR   The color of the "off" path default: red
  --line_width LINE_WIDTH
                        Bigger numbers means thicker lines default: 1.0
  --margin MARGIN       Margin around image default: 50x50
  --width WIDTH         The image width (inside margin). Aspect ratio is maintained. default: 700.0
  --borders BORDERS     Comma separated list of borders default: blue:1
  --recursive           Perform recursive scan on directories. default: False
  --no-recursive        See --recursive
  --continue_on_error   Ignore parsing errors and omit the offending file. default: False
  --no-continue_on_error
                        See --continue_on_error
  --out_dir OUT_DIR     Output directory format. default: {path_name}
  --out_name OUT_NAME   Output file name format. default: {base_name}.svg
  --suffix SUFFIX       Suffix filter for recursive search. default: qli
  --print_progress      Show progress of parsing. default: False
  --no-print_progress   See --print_progress
  --raster_image RASTER_IMAGE
                        Add conversion to . default: <class 'str'>
  --raster_out RASTER_OUT
                        Comma separated list of raster types to generate default:

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

qli-0.1.3.tar.gz (29.3 kB view details)

Uploaded Source

Built Distribution

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

qli-0.1.3-py3-none-any.whl (30.0 kB view details)

Uploaded Python 3

File details

Details for the file qli-0.1.3.tar.gz.

File metadata

  • Download URL: qli-0.1.3.tar.gz
  • Upload date:
  • Size: 29.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for qli-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1e0b88ef4eded77ecc0da419ebe111f842f718f086030c12f9ffeda39c6136f4
MD5 2ed641358903c123211de7602248c430
BLAKE2b-256 2fe269553112981d7e810104ed87642ca588e61f75ba3e039f2b8fd1b2247572

See more details on using hashes here.

Provenance

The following attestation bundles were made for qli-0.1.3.tar.gz:

Publisher: publish.yml on owebeeone/qli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qli-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: qli-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 30.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for qli-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f96a521e4f678ac550219ebac7fc10fbb2e52dfc0eb58814d77293e4f019e982
MD5 6a721c5c8ff60da95d20f2542663c879
BLAKE2b-256 08e38631d67431d037479e8cb72fff492c08727b7576f7028d41fda3a9fb493a

See more details on using hashes here.

Provenance

The following attestation bundles were made for qli-0.1.3-py3-none-any.whl:

Publisher: publish.yml on owebeeone/qli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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