Skip to main content

Lightweight UUT measurement reporting library — HTML, Excel, and PDF output with pass/fail evaluation

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

instrumation_report-0.0.1.tar.gz (110.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

instrumation_report-0.0.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file instrumation_report-0.0.1.tar.gz.

File metadata

  • Download URL: instrumation_report-0.0.1.tar.gz
  • Upload date:
  • Size: 110.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for instrumation_report-0.0.1.tar.gz
Algorithm Hash digest
SHA256 39ccfe63e755d303c0309aac49c80414f7ab61ef8eae488eba0afbabc8a9a4e3
MD5 e1fd34eb7d1409e64b70a32b375e183e
BLAKE2b-256 6e075fa0413a31a9ea0b20ebf88ae61009f7db5619262d68187e12ea19e65fee

See more details on using hashes here.

Provenance

The following attestation bundles were made for instrumation_report-0.0.1.tar.gz:

Publisher: release.yml on abduznik/instrumation-report

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file instrumation_report-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for instrumation_report-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cc569d02ead0bd1537cb61e7afd359b23568e8b11338651b7c4d693effef3d85
MD5 3118526029893d53ea16ef1d9c46de69
BLAKE2b-256 6db6c95c2631ffb65c7d9d1b9abbe90266d690e90f7f25acb107ccddb89283e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for instrumation_report-0.0.1-py3-none-any.whl:

Publisher: release.yml on abduznik/instrumation-report

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page