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 usagegenerate_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39ccfe63e755d303c0309aac49c80414f7ab61ef8eae488eba0afbabc8a9a4e3
|
|
| MD5 |
e1fd34eb7d1409e64b70a32b375e183e
|
|
| BLAKE2b-256 |
6e075fa0413a31a9ea0b20ebf88ae61009f7db5619262d68187e12ea19e65fee
|
Provenance
The following attestation bundles were made for instrumation_report-0.0.1.tar.gz:
Publisher:
release.yml on abduznik/instrumation-report
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
instrumation_report-0.0.1.tar.gz -
Subject digest:
39ccfe63e755d303c0309aac49c80414f7ab61ef8eae488eba0afbabc8a9a4e3 - Sigstore transparency entry: 1980697008
- Sigstore integration time:
-
Permalink:
abduznik/instrumation-report@ef52e2b19a9804d70075816861d96fad7877ac28 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/abduznik
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ef52e2b19a9804d70075816861d96fad7877ac28 -
Trigger Event:
push
-
Statement type:
File details
Details for the file instrumation_report-0.0.1-py3-none-any.whl.
File metadata
- Download URL: instrumation_report-0.0.1-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc569d02ead0bd1537cb61e7afd359b23568e8b11338651b7c4d693effef3d85
|
|
| MD5 |
3118526029893d53ea16ef1d9c46de69
|
|
| BLAKE2b-256 |
6db6c95c2631ffb65c7d9d1b9abbe90266d690e90f7f25acb107ccddb89283e1
|
Provenance
The following attestation bundles were made for instrumation_report-0.0.1-py3-none-any.whl:
Publisher:
release.yml on abduznik/instrumation-report
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
instrumation_report-0.0.1-py3-none-any.whl -
Subject digest:
cc569d02ead0bd1537cb61e7afd359b23568e8b11338651b7c4d693effef3d85 - Sigstore transparency entry: 1980697145
- Sigstore integration time:
-
Permalink:
abduznik/instrumation-report@ef52e2b19a9804d70075816861d96fad7877ac28 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/abduznik
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ef52e2b19a9804d70075816861d96fad7877ac28 -
Trigger Event:
push
-
Statement type: