Generate sheet or individual labels for Homebox locations and assets using pluggable templates. This project ships with:
- Avery 5163 2"x4" sheets (customizable per-label orientation)
- Brother P‑touch 24mm continuous tape (normal + minimal)
The primary entry point is the web UI in homebox_labels_web.py.
Homebox’s built‑in label support is rudimentary. Locations only have UUIDs, which are useless on physical labels. This project treats a portion of the location name as a human‑readable ID, prints it consistently, and renders QR codes to jump directly to the Homebox UI.
Because Homebox doesn’t support user‑friendly IDs, we encode them in the name.
Default convention:
BOX.010 | Electrical Supplies
RACK.005 | Left rack on front wall
- The ID format is
<TYPE>.<NUMBER>(e.g.,BOX.010,RACK.005). - Fixed width numeric IDs keep font size consistent and readable.
- The default separator is
|, but the matching regex is configurable.
You can override the pattern with:
HOMEBOX_LOCATION_ID_REGEX=...
Because Homebox doesn’t auto‑increment IDs:
- Add locations as
BOX.XXX | Some name. - Fill them with items in Homebox.
- Open
homebox_labels_web(the “Show only with ID” toggle is on by default). - The table is sorted by ID (desc), so all
BOX.XXXentries are grouped up top. - Find the largest ID just below the last
BOX.XXX(e.g.,BOX.072). - Click the
BOX.XXXlink to open the Homebox location. - Rename to
BOX.073,BOX.074, etc. - Select the new IDs and generate labels.
- Sheet PDF output.
- Per‑label options: orientation (horizontal/vertical) + outline.
- You can print multiple copies of each label in different orientations. Useful for e.g. Sterilite boxes that need horizontal labels on side face and vertical on end face.
- Individual label output (zipped PNG bundle).
- Options:
normalorminimal. - For chain printing the zipped PNG bundles on macOS, this is very useful: ptouch-print-macOS
Templates use a fork of Inter with slashed zero, available at pfa230/inter. The font itself is bundled with the project.
python -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txtCreate a .env file (or export vars):
HOMEBOX_API_URL=http://localhost:7745
HOMEBOX_BASE_URL=http://localhost:7745
HOMEBOX_USERNAME=...
HOMEBOX_PASSWORD=...
# Optional
HOMEBOX_LOCATION_ID_REGEX=^\s*([^|]+?)\s*\|\s*(.*)$
HOMEBOX_BASE_URL controls the base used for UI links/QR codes.
USE_RELOADER=1 python homebox_labels_web.pyDefault UI is on http://127.0.0.1:4000 when running locally.
docker pull ghcr.io/pfa230/homebox_labels:latest
docker run --rm -p 4000:4000 \
-e HOMEBOX_API_URL=... \
-e HOMEBOX_BASE_URL=... \
-e HOMEBOX_USERNAME=... \
-e HOMEBOX_PASSWORD=... \
ghcr.io/pfa230/homebox_labels:latestThe image is published as ghcr.io/pfa230/homebox_labels:<tag>
and ghcr.io/pfa230/homebox_labels:latest.
Example docker-compose.yml:
services:
homebox-labels:
image: ghcr.io/pfa230/homebox_labels:latest
ports:
- "4000:4000"
environment:
HOMEBOX_API_URL: ${HOMEBOX_API_URL}
HOMEBOX_BASE_URL: ${HOMEBOX_BASE_URL}
HOMEBOX_USERNAME: ${HOMEBOX_USERNAME}
HOMEBOX_PASSWORD: ${HOMEBOX_PASSWORD}
FLASK_SECRET_KEY: ${FLASK_SECRET_KEY:-homebox-labels-ui}
restart: unless-stoppedpython -m pip install -r requirements-dev.txt
pyright
flake8
python -m unittest discover -s tests -p "test_*.py" -vMIT. See LICENSE.