Skip to main content

bobina

Print Markdown on thermal roll printers — receipts, lists, labels, QR codes, payment codes (Pix, UPI, SEPA…), photos — with calibrated defaults, a preview you can trust, and nudges instead of blocks.

bobina print "# MARKET\n- [ ] milk\n- [ ] bread"
bobina print list.bob.md
bobina template new receipt sale.bob.md && bobina print sale.bob.md

Every command that prints shows a confirmation screen first (the dry run): a terminal preview on the real 32-column grid, paper length, counters it will use, and nudges with the evidence behind them. p prints; --yes skips it. Without a terminal (scripts, agents, ssh) add --yes: otherwise nobody can answer and the print stops with E107 (exit 7). -n shows the screen and prints nothing. Agents: start at llms.txt (or llms-full.txt, everything in one file); a ready skill is in skills/bobina/SKILL.md.

┌─ preview · mtp-ii-58 · 58 mm ──┐
│                                │
│M A R K E T                     │
│                                │
│☐  milk                         │
│☐  bread                        │
└────────────────────────────────┘
 ~3.1 cm of paper · 1 native rows, 2 raster · 2.9 KB
 [p] print   [s] save as…   [q] quit

Why

Cheap 58/80 mm printers are good enough for a lot — if something takes care of their limits. bobina was calibrated on a minimum-quality printer (Goldensky MTP-II): every default comes from a printed and photographed test, so what works there works on better printers. You can ask for anything; bobina only warns, and tells you why (warning[Q101] … (evidence: N6)).

  • One engine for check, preview and print: the PNG preview is the exact dot pattern sent.
  • Native when the printer does it well, raster when it does not — per line, decided by the printer profile (glyphs the font lacks, italic, inverted bands, drawn checkboxes).
  • Readable documents: plain Markdown plus Pandoc-style attributes. See docs/FORMAT.md.
  • Safe data: values from CSV or --set are printed literally and can never inject Markdown, template code or printer commands; templates run in a sandbox.

Install

curl -LsSf https://raw.githubusercontent.com/rafaelbressan/bobina/main/get.sh | sh   # installs uv if missing
# or: uv tool install bobina · pipx install bobina · a .deb or Homebrew: docs/INSTALL.md
bobina init                   # printer, profile, locale, roll, test strip
bobina init --yes             # agents, scripts: no questions, no print

Bluetooth printing needs Linux and the system Python (get.sh picks it). The .deb, pipx, the boot service and a checkout: docs/INSTALL.md. Printer on another machine? bobina init --command "ssh tower bobina send --yes -". No printer at hand? bobina init --yes --printer ./out.bin: every job's bytes are appended to out.bin (a file printer). Dates and money: the first check, preview or print takes the locale from the time zone and saves it (M203); bobina config set locale en-US changes it.

The format in one screen

---
locale: pt-BR
counters:
  ticket: { start: 1, format: "A-{:03}" }
fonts:
  body: native                 # the printer's own font (fast)
  hand: Z003                   # any alias you like
---
# TICKET {{ seq.ticket }} {.invert .center}

{{ now | date("full") }}        <!-- quinta-feira, 5 de novembro de 2026 -->

- [ ] open task
- [x] done task (struck)

| Item | Qty | Price |
|---|--:|--:|
| Bread | 6 | {{ 4.8 | currency("BRL") }} |

```qr
https://example.com
```

```pay {scheme=pix to="you@example.com" name="Shop" city="Rio" amount=10.00}
```

Signed, [Ana]{font=hand size=32px}

--- {.cut}

bobina help format has the rest: sizes (small…huge, physical mm), dividers, barcodes, Data Matrix, PDF417, images (dither and gamma), rotation, upside-down text, templates and data.

One label per row

A document with {{ blanks }} plus a table (CSV, TSV, JSON, Excel) prints one label per row; the columns fill the blanks. Step by step: docs/guides/batch-printing.md; in the terminal: bobina help data.

bobina check jar-label.bob.md --data pantry.csv                 # paper length, problems, the columns: no print
bobina print jar-label.bob.md --data pantry.csv --where shelf=A --copies-from jars --yes  # jars=0: no label
bobina print tag.bob.md --data stock.xlsx --sheet Estoque --yes  # a sheet other than the first
bobina print shelf-tag.bob.md --data a=prices.xlsx --join b=catalog.json --on name --yes  # {{ a.price }} {{ b.id }}
bobina print note.bob.md --set produto=Feijão --set validade=2027-01-31 --yes   # one value, no table
bobina preview jar-label.bob.md --data pantry.csv -o 'labels/{product}.png'    # one PNG per label

A {{ name }} that is not a column prints empty and is reported (M130, with the columns the data has).

Commands

Command Does
print [FILE | "TEXT" | -] render → confirm → print. --data rows.csv (above), --set KEY=VALUE, --copies N (identical), --repeat N (new counter values each), -o job.bin (save, do not print); stops after each label (--no-step)
print --last / --again reprint the last job: identical bytes / re-rendered (new now and counters); with -o FILE save instead
check FILE problems, paper length, native/raster rows, nothing printed (--data, --json → {"stats", "problems"}, --strict)
preview FILE | "TEXT" exact PNG (-o out.png); --data rows.csv -o 'dir/{column}.png' one per label; --realistic simulates ink spread
view FILE preview in the terminal
edit [FILE] [--template NAME] write in your editor, confirm, print
template list | show | new receipt, label, todo, card, note, and a shop gallery: guides/templates.md
seq list | set | reset persistent counters ({{ seq.NAME }}); seq set ticket 100: the next print uses 100
init first run; again to change one part
printer scan | add | list | use | remove | show | set printers live in ~/.config/bobina/config.toml
config list | get | set | unset | edit the other settings (config set step off)
status, mode [esc|tspl|cpcl] printer state; command language
calibrate compare PHOTO FILE how close the preview is to the paper
calibrate tear / calibrate feed where the tear bar is; whether feeds after images need the safe mode
paper [new 15m | used 3m] paper left on the roll (the printer only reports "out")
profile list | show, fonts list, send FILE.bin profiles, tested fonts, raw bytes
mcp a server for AI agents (MCP; uv tool install 'bobina[mcp]', then claude mcp add bobina -- bobina mcp): docs/mcp.md

bob is the same binary. Short aliases exist for typing (bobina help aliases); docs always use full names. Exit codes: 0 ok · 1 usage · 2 document · 3 strict nudges · 4 unreachable · 5 printer not ready · 6 language · 7 confirmation needed/declined · 8 security · 9 a payment or contact code left out (Q111, Q112) · 10 newer release.

Repository

Path What
src/bobina/ the package (engine, layout, ESC/POS, preview, CLI) and built-in profiles, templates, fonts
docs/ FORMAT.md (the .bob.md spec), CLI.md (commands, options, problems, exit codes), SECURITY.md (threat model), guides/batch-printing.md, guides/tables.md, TESTED.md (what was and was not tested on paper)
examples/ documents and data used by the guides (examples/batch/)
spec/conformance/ test tickets with expected bitmaps — a bob/1 implementation renders them identically
tests/ unit, security and golden tests (no printer needed)
docs/printers/ measured capabilities of each profiled printer (mtp-ii-58.md)
contrib/ Bluetooth boot service for Linux (install.sh sets it up)
tools/ maintenance scripts: public export and personal-data scan

Status

Pre-release (v0.x). MIT licensed (bundled fonts keep their own licenses: src/bobina/fonts/LICENSES.md). Baseline profile: mtp-ii-58 (measured); 32 more imported from escpos-printer-db, not measured on paper (bobina profile list; calibrate before trusting them). Realistic preview is an estimate until the profile is calibrated from photos (preview.calibrated = false).

Hardware notes (MTP-II)

Symptom Likely cause
printer unreachable printer off or asleep: press POWER until the yellow LED is steady
Blank output roll upside down (the side that darkens with a fingernail faces the head)
Turns off when printing battery: charge it; first use: remove the film on the battery contacts
Prints garbage another app sent a different command language (TSPL/CPCL) as text; the MTP-II itself only speaks ESC/POS
Self-test printer off → hold FEED, press POWER, release at the beep
The last line stops at the tear bar, or a --marks tear line is off bobina calibrate tear (a ruler: tear it and read the mm), then bobina calibrate feed (does the printer obey a paper feed right after an image?)

Metadata

Release files for bobina 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bobina 0.1.4
File Size Uploaded Provenance Actions
bobina-0.1.4.tar.gz 3.1 MB With provenance Details for bobina-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bobina 0.1.4
File Interpreter ABI Platform Actions
bobina-0.1.4-py3-none-any.whl Python 3 none any Details for bobina-0.1.4-py3-none-any.whl

Total release size: 5.6 MB

Release files / bobina-0.1.4.tar.gz

Download URL bobina-0.1.4.tar.gz
Size 3.1 MB
Tags Source
SHA-256 checksum
How to use checksums
66ec87f4a7f69268e604de15571bb4695e31502821e21ca5aa9d0dc67fbbc6a5
BLAKE2b-256 checksum
How to use checksums
8a7f12d2d00ff8f94c1a1bffd89d1ad8338668e55c8c6b4268b0eb50cdb8ac69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / bobina-0.1.4-py3-none-any.whl

Download URL bobina-0.1.4-py3-none-any.whl
Size 2.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
3aa11e218cb87547dd1a21141e3f97d5555ab1948f98b476d77899892de56cc5
BLAKE2b-256 checksum
How to use checksums
8b8f403bc8d38dede129fe563f0c1f3d33c1ef2c54ea263e630e7261d31bdc45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Security for bobina 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bobina-0.1.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page