Skip to main content

instrumation-report

A lightweight Python library for generating structured UUT (Unit Under Test) test reports from measurement data. Outputs HTML, Excel, and PDF. Works standalone or alongside the instrumation library.

Install

pip install instrumation-report

# PDF support (requires weasyprint system deps — see weasyprint docs)
pip install "instrumation-report[pdf]"

Quick start

from instrumation_report import Report, ReportHeader, Section, TestTable, Measurement

report = Report(header=ReportHeader(
    title="RF Subsystem Validation",
    subtitle="Production Test",
    engineer="Yan",
    uut_name="Signal Analyzer Module",
    uut_serial="SN-2024-001",
    revision="A",
))

section = Section(number="1", title="Voltage Tests")
table = TestTable(title="Power Supply Checks", sub_number="1.1")
table.add(Measurement("3.3V Rail", 3.31, "V", condition=(3.2, 3.4), test_number="1.1.1", expected="3.2-3.4V"))
table.add(Measurement("5V Rail",   5.02, "V", condition=(4.9, 5.1), test_number="1.1.2", expected="4.9-5.1V"))
section.add_table(table)
report.add_section(section)

report.generate_html("report.html")
report.generate_excel("report.xlsx")
report.generate_pdf("report.pdf")   # requires [pdf] extra

Condition types

Type Example Passes when
Range tuple (1.0, 5.0) lo <= value <= hi
Lambda lambda v: v > 4.0 callable returns True
Threshold float 3.0 value >= threshold
None (omit) always N/A

Flat usage (simple reports)

r = Report()
r.add(Measurement("Voltage", 4.7, "V", condition=(4.0, 5.0)))
r.add(Measurement("Current", 1.2, "A", condition=lambda v: v < 2.0))
r.generate_html("report.html")

API

ReportHeader

Field Type Default
title str (required)
subtitle str ""
engineer str ""
uut_name str ""
uut_serial str ""
revision str ""
date str today (ISO 8601)
extra_fields dict {}

Measurement

Field Type Default
name str (required)
value float (required)
unit str ""
condition lambda / tuple / float / None None
test_number str ""
expected str ""
notes str ""
description str ""

Section(number, title, subtitle="")

  • add_table(table: TestTable)

TestTable(title, sub_number)

  • add(measurement: Measurement)

Report(header=None)

  • add_section(section: Section)
  • add(measurement) — flat backwards-compatible usage
  • generate_html(path)
  • generate_excel(path)
  • generate_pdf(path) — requires [pdf] extra

Development

python -m venv .venv && source .venv/bin/activate
pip install -e ".[test]"
pytest -v

License

MIT

Metadata

Release files for instrumation-report 0.0.1

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

Source distribution (sdist)

Source distribution for instrumation-report 0.0.1
File Size Uploaded
instrumation_report-0.0.1.tar.gz 110.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for instrumation-report 0.0.1
File Interpreter ABI Platform
instrumation_report-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 120.6 kB

Release files / instrumation_report-0.0.1.tar.gz

Download URL instrumation_report-0.0.1.tar.gz
Size 110.2 kB
Tags Source
SHA-256 checksum
How to use checksums
39ccfe63e755d303c0309aac49c80414f7ab61ef8eae488eba0afbabc8a9a4e3
BLAKE2b-256 checksum
How to use checksums
6e075fa0413a31a9ea0b20ebf88ae61009f7db5619262d68187e12ea19e65fee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 27, 2026.

Transparency log

Release files / instrumation_report-0.0.1-py3-none-any.whl

Download URL instrumation_report-0.0.1-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc569d02ead0bd1537cb61e7afd359b23568e8b11338651b7c4d693effef3d85
BLAKE2b-256 checksum
How to use checksums
6db6c95c2631ffb65c7d9d1b9abbe90266d690e90f7f25acb107ccddb89283e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

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