This release is a pre-release and may not be stable for production use.
Increment Metrics
Define measures and metrics once, independently of a warehouse connection or an analysis. This package validates definitions and selects the dependencies needed by a consumer. It does not read warehouse data or evaluate metrics.
The distribution is increment-metrics; it imports as increment_metrics and
does not require Increment or Terrine.
from increment_metrics import Catalog, load
catalog = load("examples/shop/metrics.yaml")
selected = catalog.select(["average_order_value"])
assert set(selected.measures) == {"revenue", "order_count"}
schema = Catalog.model_json_schema() # JSON Schema for the YAML input
Use plain YAML mappings, lists, and scalars. Explicit YAML tags, aliases, and merge keys are not supported.
Version 1
- A source names a table, its unique non-null
row_key, entity columns, and optionally its event-time column. Use simple ASCII identifiers for columns and each segment of a qualifiedtablename, not SQL fragments. - A dimension names a column and its type (
string,boolean,integer,number,date, ortimestamp). A named join maps a localforeign_keyto another source'srow_key. Usejoin.dimensionto refer to a joined dimension. Only many-to-one joins to a unique key are supported. - A filter names its source and a nonempty list of conditions, all of which
must hold. A condition names a dimension and uses
eq,ne,lt,le,gt,ge, orin. Use a typed scalar, or a nonempty list forin. Use ISO dates (YYYY-MM-DD) and ISO timestamps. Null is not a comparison value. - A measure sums a column (
sum) or counts qualifying rows (count_rows: true). Its optional filter applies only to that measure. - A population names a source keyed by the declared entity. This is the eligible roster, not the set of entities with activity. The roster and the measured source must name the same entity; their physical key names may differ.
- A metric is a
formula,per_unit_mean, orconversion. Formulas combine named measures and metrics with finite numbers,+,-,*,/and parentheses. Means average over an explicit population. Conversions count an eligible entity once if it has any qualifying events.
Compute formula operands at the requested unit or grouping, then apply the arithmetic. For example, average order value is total revenue divided by total orders, not the average of per-customer order values. Zero orders means the ratio is undefined. A customer with known-complete coverage and no qualifying orders contributes zero to a count or sum; missing coverage is not zero.
Validate physical keys and data coverage in the consumer. Included amounts must be non-null; row, roster and dimension keys must be unique and non-null in the same input snapshot. A consumer must reject a population or grouping it cannot represent. A valid catalog does not establish that any workload can execute it.
The shop fixture contains the definitions, input SQL, matched scope, and hand-derived results. Existing product-specific settings such as exposure rules and snapshot windows belong in the consumer, not in this file.
Use the same metric in another tool
| Consumer | Entry point | Scope |
|---|---|---|
| Increment | from_definitions with metric_definitions |
Additive ratios, eligible-unit means, and event-presence conversions with matching native bindings |
| Terrine | Model.from_metric_definitions, then an ordinary Design |
Named formulas over aligned window aggregates; readiness and roster binding stay native |
| Malloy | increment_metrics.malloy.export_malloy |
Native fields and grouping over compatible fact or roster sources |
The migration and conformance guide shows how to reuse AOV without rewriting an experiment or a Terrine Design. The comparison uses matched DuckDB inputs and candidate builds, not released package compatibility.
Metadata
Release files for increment-metrics 0.1.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| increment_metrics-0.1.0a1.tar.gz | 19.2 kB | With provenance | Details for increment_metrics-0.1.0a1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| increment_metrics-0.1.0a1-py3-none-any.whl | Python 3 | none | any | Details for increment_metrics-0.1.0a1-py3-none-any.whl |
Total release size: 42.6 kB
Release files / increment_metrics-0.1.0a1.tar.gz
| Download URL | increment_metrics-0.1.0a1.tar.gz |
|---|---|
| Size | 19.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e5cca64e68347d26f3b985e382305ceeff18edecd6b1609b962b6e4996e6ddc
|
|
BLAKE2b-256 checksum How to use checksums |
ece77431c246878b160b7c99b29e54afc7d2697f14f275b4bb7a9dd1e0020d43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.
Transparency logRelease files / increment_metrics-0.1.0a1-py3-none-any.whl
| Download URL | increment_metrics-0.1.0a1-py3-none-any.whl |
|---|---|
| Size | 23.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1af232a9faab75b362d68a3bbd1b4ad1dc9a6ca6f20d31db9914b973d40c2062
|
|
BLAKE2b-256 checksum How to use checksums |
523dc105b0802ad4848a1cab9417f07a26655f214df5d199b34e09da4b74eb35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.
Transparency logSecurity for increment-metrics 0.1.0a1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for increment_metrics-0.1.0a1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.