Label generator for fasteners stored in the Hackerspace Wrocław workshop.
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.csvfrom fastener_label_generator import FastenerLabelGenerator
pdf_content = FastenerLabelGenerator.generate_pdf("franek", "franek", [{"thread": "M3"}])
open("label.pdf", "wb").write(pdf_content)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.
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_generatorand hack away.
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
This repository does not (as of now) include fonts; you need to install them manually in your system.
- Franciszek Maroszek
- Kosma Moczek
- Bartłomiej Pytko
- blabel - image generation
- FreeCAD Fasteners Workbench - fasteners icons
- Wikipedia - screwdriver bits icons