Unit tests for business metrics. Contract testing for analytical meaning.
Project description
MetricSpec
Unit tests for business metrics. Contract testing for analytical meaning.
MetricSpec is a Python CLI for testing analytical contracts in local development and CI. It starts with deterministic DuckDB fixture tests and produces explainable diagnostics when a business metric returns the wrong answer.
Quick Start
From a local checkout before MetricSpec is published as a package:
uv sync --extra dev
uv run metricspec init demo
cd metricspec-demo
uv run --project .. metricspec run
After package publication, the same flow can use uvx without a checkout:
uvx metricspec init demo
cd metricspec-demo
uvx metricspec run
What MetricSpec Is
- A contract test runner for business metrics.
- A fixture-first semantic regression tool.
- A CI-friendly way to catch wrong analytical answers.
What MetricSpec Is Not
- A semantic layer.
- A general data quality platform.
- A hosted observability dashboard.
Status
The stable v1 core is DuckDB fixture-based contract testing. Additional adapters are experimental.
Documentation
Security
MetricSpec should not send telemetry or make hidden network calls. Keep credentials, production data, and secrets out of contracts, fixtures, issue reports, and CI artifacts.
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 metricspec-0.1.0.tar.gz.
File metadata
- Download URL: metricspec-0.1.0.tar.gz
- Upload date:
- Size: 105.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e328409a00ef409cce0b3933821aba7e096170ea85f83ff1080d101842d384fb
|
|
| MD5 |
f92edb29a76ca50461c322c44b7a03f0
|
|
| BLAKE2b-256 |
34d4c98becfe89764e80445461a6ff0da3705f84071c694b884b576d09ec4e05
|
Provenance
The following attestation bundles were made for metricspec-0.1.0.tar.gz:
Publisher:
publish.yml on johnmikel/metricspec
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metricspec-0.1.0.tar.gz -
Subject digest:
e328409a00ef409cce0b3933821aba7e096170ea85f83ff1080d101842d384fb - Sigstore transparency entry: 2007712494
- Sigstore integration time:
-
Permalink:
johnmikel/metricspec@0be4eca308832af2121fd1ee2ffc9211cdfd4c55 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/johnmikel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0be4eca308832af2121fd1ee2ffc9211cdfd4c55 -
Trigger Event:
push
-
Statement type:
File details
Details for the file metricspec-0.1.0-py3-none-any.whl.
File metadata
- Download URL: metricspec-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.7 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 |
ffd597a319c4c007e3c9130944c0cb40fab429bfac6edc271ee33d050108462d
|
|
| MD5 |
907a12be12d34e553aacdddd88c1c284
|
|
| BLAKE2b-256 |
5baae57664439c09d66d3e75b57dbe71b05c8eff00680c56b5c0ab09e96d97cd
|
Provenance
The following attestation bundles were made for metricspec-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on johnmikel/metricspec
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metricspec-0.1.0-py3-none-any.whl -
Subject digest:
ffd597a319c4c007e3c9130944c0cb40fab429bfac6edc271ee33d050108462d - Sigstore transparency entry: 2007712650
- Sigstore integration time:
-
Permalink:
johnmikel/metricspec@0be4eca308832af2121fd1ee2ffc9211cdfd4c55 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/johnmikel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0be4eca308832af2121fd1ee2ffc9211cdfd4c55 -
Trigger Event:
push
-
Statement type: