Skip to content

HackerspaceWroclaw/fastener_label_generator

Repository files navigation

fastener_label_generator

Label generator for fasteners stored in the Hackerspace Wrocław workshop.

Installation

Command line usage

Install like any standard Python utility. pipx is recommended for automatic management of venvs:

sudo apt install pipx
pipx install https://github.com/HackerspaceWroclaw/fastener_label_generator

# Usage: fastener-label-generator filename.pdf template_name style_name field=value ...
fastener-label-generator-single test.pdf martyna martyna description="Śruba z łbem sześciokątnym" thread="M3" length="12" standard="DIN 933" material="ocynk" bolt_image="din933.png"
# Usage: fastener-label-generator-batch filename.pdf template_name style_name csv_file
fastener-label-generator-batch test.pdf martyna martyna screws.csv

Library usage

from fastener_label_generator import FastenerLabelGenerator

pdf_content = FastenerLabelGenerator.generate_pdf("franek", "franek", [{"thread": "M3"}])
open("label.pdf", "wb").write(pdf_content)

GUI usage

In order to simplify single label generation you can use dedicated GUI python script Fastener_Label_GUI.py, initially developed and tested on macOS. Make sure you have installed libraries in your venv like blabel, weasyprint, tkinter.

Development

Install the library in Editable mode:

git clone https://github.com/HackerspaceWroclaw/fastener_label_generator ~/fastener_label_generator
python -m venv ~/flg-env
source ~/flg-env/bin/activate
pip install -e ~/fastener_label_generator

and hack away.

Rendering

When developing a label, it might be useful to render it down to the printer pixel size and make sure all the small features are rendered correctly. E.g. for the Zebra TLP 2824 Plus printer:

convert -density 203 -flatten malpa.pdf malpa.png

Fonts

This repository does not (as of now) include fonts; you need to install them manually in your system.

Authors

  • Franciszek Maroszek
  • Kosma Moczek
  • Bartłomiej Pytko

Credits

About

Label generator for fasteners stored in Hackerspace

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •