Skip to content

v0.3.0 — PDF reports + smarter table alignment

Choose a tag to compare

@ralfbecher ralfbecher released this 24 May 15:20

First tagged release. Two user-visible additions on top of v0.2.0.

PDF report output

format: pdf reuses the HTML pipeline via WeasyPrint, so PDF layout stays in lockstep with HTML automatically. A print-only stylesheet adds A4 margins, a page n / total footer, and page-break hints on h2 / tr so tables don't get orphaned across pages.

report:
  format: pdf
  output: reports/{name}-{date}.pdf
  title: "Monthly Revenue — {date}"

PDF is gated behind an optional extra because WeasyPrint depends on system libraries (Pango / Cairo / GDK-Pixbuf) that not every install target carries:

uv sync --extra pdf      # also: brew install pango  (macOS)

On Apple Silicon, Homebrew installs libs to /opt/homebrew/lib, which Python's loader doesn't search by default — prefix the runner with DYLD_FALLBACK_LIBRARY_PATH=/opt/homebrew/lib or export it in your shell. See README → Install for full platform notes.

Sample output: examples/monthly-revenue-2026-04-29.pdf.

Right-aligned numeric columns (only when they should be)

Table cells right-align when a column is a formatted numeric measuretype == "number" and format is set on the column metadata. Bare integer IDs (Order Key, Customer ID) come back from OBSL without a format pattern and stay left-aligned with their text neighbours, so reports don't look like "DE | 52965 | 5.000,00" with a misaligned ID column.

Uses GFM ---: syntax in the markdown table separator so the alignment hint propagates to HTML and PDF automatically via Python-Markdown's tables extension. CSS adds font-variant-numeric: tabular-nums so digits line up vertically in HTML/PDF.

Column kind Example Alignment
String Country, Customer Name left
Datetime / binary Order Date left
Number with format Revenue (#,##0.00) right
Number without format Order Key (bare integer ID) left

Install

pip install orionbelt-runner==0.3.0
# or, with the PDF extra:
pip install 'orionbelt-runner[pdf]==0.3.0'

Full diff

fc8a737...v0.3.0