Skip to content

Label generator with SVG templates supporting embedded Python code and CSV data

License

Notifications You must be signed in to change notification settings

ducky64/pysvglabel

Repository files navigation

pysvglabel

Label generator with SVG templates supporting embedded Python code and CSV data

Template Output
Design Template
source SVG
with supporting code
Generated Labels
from data CSV

Usage

python pysvglabel <template.svg> <data.csv>

Label sheet data is embedded in the .svg file. All text in the .svg file is treated as Python f-strings, and the contents of the row (where the column name is a legal Python variable name) are made available. Specially formatted commands (see Template Reference) that call Python functions (such as generating barcodes) can also be written into the template.

Security notes: running the labelmaker can execute arbitrary Python code embedded in the template SVG and supporting scripts. There should be no issues if you're designing your own template from scratch. Treat templates from the internet as you might treat a document with macros - make sure you trust it before running it. Not all embedded Python code may be visible graphical elements.

Windows Label Printing

Additional packages are needed to use the label printer functionality on Windows.

pip install pywin32

Inkscape also needs to on your system PATH.

Template Reference

TBD

Developing

This project uses optional static typing annotations. You can run mypy using:

mypy .

If using IntelliJ, you can use the Mypy plugin.

About

Label generator with SVG templates supporting embedded Python code and CSV data

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages