How egrqwertyuio/label-station works
Label Station is an offline Flask appliance for composing and printing TSPL2 labels. A user opens the web interface, fills a built-in or uploaded custom template, or uploads a spreadsheet for column mapping and row review; approved jobs are compiled and sent to a USB printer, with preview and status handling. The designer creates template files on the user's computer, while the station keeps uploaded templates in memory. The source index supports the main module dependencies; unsampled routes and browser interactions are represented only where the README or excerpts document them.
Main entry points: app.py Flask web app · tspl.py TSPL2 job compiler · custom_templates.py Custom template validation · printer.py Printer transport and status
Components 16
Web experience
- Flask web app
app.py - Web pages and scripts
templates - Browser label designer
static/designer.js
Templates and input
- Built-in templates
templates_def.py - Custom template validation
custom_templates.py - Spreadsheet reading and mapping
sheets.py
Job processing
- Batch review and runner
batch.py - Print configuration
config.py - TSPL2 job compiler
tspl.py - TrueType text rasterizer
textraster.py - Image bitmap conversion
logo_tool.py - QR bitmap encoder
qr_tool.py
Rendering and printing
- Job preview renderer
preview.py - Printer transport and status
printer.py - TSPL2 thermal printer
Other components
- Phone or laptop user
Connections 27
- Phone or laptop user → Flask web app: uses
- Flask web app → Web pages and scripts: renders pages
app.py - Flask web app → Built-in templates: selects template
app.py - Phone or laptop user → Browser label designer: designs labels
- Browser label designer → Custom template validation: uploads template
- Flask web app → Custom template validation: validates upload
app.py - Flask web app → Spreadsheet reading and mapping: reads upload
app.py - Spreadsheet reading and mapping → Built-in templates: maps fields
sheets.py - Flask web app → Batch review and runner: builds and runs review
app.py - Batch review and runner → TSPL2 job compiler: builds jobs
batch.py - Batch review and runner → Printer transport and status: sends and waits
batch.py - Flask web app → TSPL2 job compiler: builds jobs
app.py - Flask web app → Printer transport and status: dispatches print
app.py - Flask web app → Print configuration: loads settings
app.py - Batch review and runner → Print configuration: loads settings
batch.py - TSPL2 job compiler → Print configuration: validates geometry
tspl.py - TSPL2 job compiler → Built-in templates: compiles template
tspl.py - Custom template validation → Built-in templates: creates template objects
custom_templates.py - TSPL2 job compiler → TrueType text rasterizer: rasterizes text
tspl.py - TSPL2 job compiler → Image bitmap conversion: converts pictures
tspl.py - TSPL2 job compiler → QR bitmap encoder: encodes QR
tspl.py - Custom template validation → QR bitmap encoder: validates QR content
custom_templates.py - Custom template validation → TrueType text rasterizer: uses text rasterizer
custom_templates.py - Flask web app → Job preview renderer: renders preview
app.py - Printer transport and status → Job preview renderer: renders mock output
printer.py - Printer transport and status → TSPL2 job compiler: transports job bytes
printer.py - Printer transport and status → TSPL2 thermal printer: writes TSPL2
printer.py