ducky64 / labelmaker

Labelmaker using SVG templates and CSV data
GNU General Public License v2.0
8 stars 5 forks source link

labelmaker

Label sheet generator using SVG templates and CSV data.

Superseded by pysvglabel

pysvglabel makes more consistent use of Python syntax and interprets templates as Python code to allow more powerful data transformation and SVG manipulation. This repository is no longer developed, but if your needs are basic SVG text substitution and barcoding, this will probably still get the job done.

Example

Template CSV Output
Image resistors.csv Image

Caveat Emptor

This is still in development and the API, including label template format and syntax, is subject to change.

Usage

python labelmaker.py <template-svg> <sheet-cofig> <csv-data> <output-filename> [--start_row=n] [--start_col=n] [--dir=dir]

where the arguments are:

Requirements

Works best on Python3. Barcode functionality requires PIL, a Python imaging library.

Templates

Templates are SVG files with the page sized to a single label. For each row in the CSV data file, the contents of the template are duplicated and shifted by a specified amount.

Syntax

The template command syntax used in this document is:

Filters

Filters modify element(s) in a template instance based on data in the CSV row. These filters are currently available (and are automatically run as part of labelmaker.py):

Configuration

Configuration parameters used to be specified in the label templates, but have been moved to a separate file. The #config command will now cause an error. Having configurations in a separate file allows the SVG templates to be sized to a single label (which may help design) and allows the same template to generate to different sized sheets.

Sheet Configuration

Sheet configuration specify the sheet parameters, like the page size, how many labels are in a sheet, and the spacing between labels. See the config/ folder for examples. Note that fields that expect a length parameter understands SVG units, so an input like 1 mm is valid.

These are options in the [sheet] section:

Copyright and acknowledgments

The following pieces of external code are used:

The repository-wide LICENSE does not cover external code, which have their own licenses in their respective files.