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>=2.0.0,<3

In pyproject.toml dependencies

dependencies = [
    "vcti-measure-report>=2.0.0,<3",
]

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-2.0.0.tar.gz (43.0 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-2.0.0-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vcti_measure_report-2.0.0.tar.gz
  • Upload date:
  • Size: 43.0 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-2.0.0.tar.gz
Algorithm Hash digest
SHA256 5ad08a8f6667cccb41437555f0a55d2a2df0b01b5a2d2c676ec5ff159ec7e769
MD5 d3d4b30a91668f162a9bfb3e0e8939c9
BLAKE2b-256 f3aa088f253e1ac716b38055bd09cfc3485e41e378b5e56aaf8111deca8546d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for vcti_measure_report-2.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-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for vcti_measure_report-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d18686679b0d20591506187ab4a3d25886e2c887fd68a8f46e8bc81d176263c9
MD5 bc3a5f16466f223d6544a0f6e1df5a10
BLAKE2b-256 6bd8e6b7e673bed713a2684bd7ae3e03283735c67de1e0cd57a0915c93619378

See more details on using hashes here.

Provenance

The following attestation bundles were made for vcti_measure_report-2.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

This release

2.0.0 This release

2 files

1.0.0

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