Skip to main content

vcti-measure-report

Reports from a vcti-measure artifact through Jinja2 templates — one projection, any output format.

An artifact records one run completely. It is not a report. Turning it into one means resolving axis labels, grouping by item, pairing each reading with the target that applies to it, and accounting for the points that produced nothing — and none of that changes when the output format does.

So this package does that work once, in Python, and leaves templates to do only syntax. It projects an artifact into flat rows carrying everything a report needs, and renders those rows through a template. Which is why one package serves HTML, Markdown and CSV, and why a user can add a format by writing a template rather than by waiting for a package.

Installation

pip install vcti-measure-report

In requirements.txt

vcti-measure-report>=1.0.0

In pyproject.toml dependencies

dependencies = [
    "vcti-measure-report>=1.0.0",
]

Quick Start

Read an artifact and render it:

from vcti.measure.report import Report

report = Report.from_text(path.read_text(encoding="utf-8"), title="Week 36")
print(report.render("summary.md"))
print(report.render("long.csv"))

A Report validates the document through vcti-measure once, when it is built, then renders as many formats as you like from that one pass. It never writes anything — rendering returns text, so storage policy stays with you.

Add your own format by writing a template:

print(report.render("our-house-style.html", template_dirs=["./templates"]))

Your template is an addition, not a replacement: the bundled names resolve first, so summary.md and long.csv are reserved. Name yours something else — including when it started life as a copy of one of ours.

A template receives flat rows — one per observation per metric, with the axis label, the unit, the target and the status already resolved — so grouping is Jinja's own groupby and selectattr, not an accumulator:

{% for item, irows in rows | selectattr("role", "equalto", "subject") | groupby("item") %}
### {{ item }}
{% for r in irows %}
| {{ r.coordinate_label }} | {{ r.metric }} | {{ r.value | quantity(r.unit) }} |
{% endfor %}
{% endfor %}

What this package does not do

  • Produce artifacts — it reads them. Declaring measurements and running instruments belong to vcti-measure and to domain packages above it.
  • Define validity — a Report does validate, by calling vcti-measure's validate_artifact: it refuses to render what core would refuse to read. The rules themselves live in one place, and it is not here.
  • Write files — rendering returns text.
  • Compare across runs — a row is joinable across artifacts by construction, but accumulating them is somebody else's job.

Each of these is explained in docs/design.md.


Dependencies

vcti-measure for the artifact and its validation, vcti-template for template loading and strict rendering, vcti-escapers for the per-medium escapers a template applies, and pydantic for the row model. Charting is deferred, and no charting dependency is taken.


Documentation

If you want to… Read
Solve a real reporting problem docs/patterns.md
Understand the architecture and design decisions docs/design.md
Navigate and change the code docs/source-guide.md
Add a format, a filter or a field docs/extending.md

Download files

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

Source Distribution

vcti_measure_report-1.0.0.tar.gz (38.4 kB view details)

Uploaded Source

Built Distribution

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

vcti_measure_report-1.0.0-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file vcti_measure_report-1.0.0.tar.gz.

File metadata

  • Download URL: vcti_measure_report-1.0.0.tar.gz
  • Upload date:
  • Size: 38.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for vcti_measure_report-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fedf5b0f66266799f94922905429cf89dc99e735de23802026c7708de0caf0a2
MD5 47afdb3da591ca97bcd392d931a01722
BLAKE2b-256 8b4218c3152977660138a3b957ae27785e2c7a0470e70a173e912b7711aa58c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for vcti_measure_report-1.0.0.tar.gz:

Publisher: release.yml on vcollab/vcti-python-measure-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 vcti_measure_report-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for vcti_measure_report-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 81dd8a1a1ff80ac171620b41fce808c2bbf7669ea7644371967c8fbc13fe3a18
MD5 c1a9013f5c081fb88ac5a70e7461b719
BLAKE2b-256 b7dfd5c6accdb9d4fa489924df22420e7a57026ca4df0172c482cbc065ab54cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for vcti_measure_report-1.0.0-py3-none-any.whl:

Publisher: release.yml on vcollab/vcti-python-measure-report

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

Release history Release notifications | RSS feed

2.0.0

2 files

This release

1.0.0 This release

2 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