Skip to content

Repository files navigation

screw-terminal-generator

Generates printable labels for electronic devices like screw terminals and pin headers, and tiles them into a grid to be cut out (e.g. with a Cricut).

Terminal Label Grid Image

Install

pip install -r requirements.txt

Usage

A label grid is described in a YAML config file (see configs/ for examples) and rendered with the CLI:

python -m screw_terminal_generator configs/DB9_1-5.yaml

The output path defaults to the config's output field, or can be overridden with -o:

python -m screw_terminal_generator configs/DB9_1-5.yaml -o out.png --show

Config format

output: DB9_1-5.png     # default output path

block:
  columns: 5             # number of label columns in one terminal block
  rows: 1                # number of label rows in one terminal block
  start_pin: 5           # pin number of the first label (also the default label text)
  length_mm: 19          # total block length in mm
  height_mm: 3.5         # total block height in mm
  labels:                 # optional per-label overrides, in order
    - text: 3V3
    - text: 12V
    - text: IN
    - text: RX
      background_color: yellow
    - text: GND

grid:
  page: letter            # auto-pack as many blocks as fit on this page ("letter", "a4", "legal")
  margin_mm: 10            # page margin to leave empty (default: 10)
  spacing_mm: 5           # spacing between repeated blocks
  # Alternatively, set an explicit layout instead of `page`:
  # rows: 3
  # columns: 4

Labels left without an explicit background_color/text_color fall back to the defaults in screw_terminal_generator/core.py (default_colors), keyed by label text (e.g. GND -> black background / white text).

Images are rendered at 300 DPI — when printing, make sure the image is printed at its original size (100% scale, not "fit to page").

Printing and cutting

With grid.page set, the CLI prints how many blocks it packed onto the page, e.g.:

python -m screw_terminal_generator configs/DB9_1-5.yaml
# Saved DB9_1-5.png (8 x 31 = 248 blocks)

Each label is drawn with its own border, so any straight cutter works. For a Cricut (or similar cutting machine) specifically:

  • Don't use Print Then Cut. It only supports a small printable/cuttable area (roughly 9.25"x6.5"), far smaller than a full sheet, and it scans each region individually with the camera — far too slow for a grid of hundreds of identical rectangles.

  • Instead, add --cut-svg to also export an SVG with one cut-line rectangle per label, in the exact same real-world (mm) positions as the printed PNG:

    python -m screw_terminal_generator configs/DB9_1-5.yaml --cut-svg
  • Print the PNG at 100% scale on your printer (onto sticker/label paper).

  • In Design Space, upload the SVG as a cut file (not Print Then Cut) and place your printed sheet on the mat aligned to its ruled corner (rather than relying on optical registration marks) so the SVG's coordinates line up with the print. Then run a normal cut — the whole sheet gets cut in one job, with no size limit from Print Then Cut.

About

Tools for generating labels for screw terminals

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages