A lightweight Python library for generating structured measurement reports from test data. HTML, Excel, and PDF output with automatic pass/fail evaluation.
Output formats
Self-contained file. Section headings, green/red badges, summary block. Opens in any browser.
Structured .xlsx with merged headers, per-row colour fills, and a summary table.
Rendered from the HTML template via weasyprint. Proper A4 page breaks and page numbers.
What the report looks like
Production Test — Board Rev A
| Test No. | Name | Value | Unit | Expected | Pass / Fail | Notes |
|---|---|---|---|---|---|---|
| 1.1.1 | 3.3V Rail | 3.31 | V | 3.2 – 3.4 V | PASS | Nominal |
| 1.1.2 | 5V Rail | 5.02 | V | 4.9 – 5.1 V | PASS | |
| 1.1.3 | 12V Rail | 11.0 | V | 11.5 – 12.5 V | FAIL | Under spec |
| 2.2.1 | Noise Figure | 3.8 | dB | < 5 dB | PASS | |
| Temperature | 24.3 | °C | — | N/A | Ambient |
Looks like this in code
from instrumation_report import Report, Measurement r = Report() r.add(Measurement("3.3V Rail", 3.31, "V", condition=(3.2, 3.4))) r.add(Measurement("5V Rail", 5.02, "V", condition=(4.9, 5.1))) r.add(Measurement("Frequency", 1002, "Hz", condition=lambda v: v > 1000)) r.generate_html("report.html") r.generate_excel("report.xlsx")