meridian-plugin-cost
Meridian V1's open-source Cost plugin provides immutable rate cards, exact Decimal pricing, deterministic allocation, versioned calculations, cost records, and reproducible explanations over logical Meridian Resources.
This distribution is a Python library and Meridian plugin. It is not a service, a Cost Catalog,
or an owner of a product-private database. It never opens Usage storage: normalized aggregates
are obtained through the released meridian-plugin-usage==1.0.0 public API. Cost data targets
distinct structured/cost/* Resources; deployment IaC owns their physical placement and keeps
Usage and Cost storage isolated.
Install
python -m pip install meridian-plugin-cost==1.0.0
Python 3.12, 3.13, and 3.14 are supported. Runtime Meridian and Usage dependencies are pinned to their compatible 1.0.0 releases.
Define and publish a rate card
from datetime import UTC, datetime
from decimal import Decimal
from meridian_storage.plugins.cost import (
CostRepository,
PricingModel,
PublicationState,
RateCardV1,
RoundingPolicy,
)
cost = CostRepository(ready_meridian)
draft = RateCardV1(
rate_card_id="cloud.api.requests",
version=1,
revision=1,
provider="example-cloud",
product="api",
meter_id="api.requests",
meter_version=1,
currency="USD",
effective_start=datetime(2026, 1, 1, tzinfo=UTC),
effective_end=datetime(2027, 1, 1, tzinfo=UTC),
pricing_model=PricingModel.FLAT_UNIT,
unit_price=Decimal("0.0025"),
rounding=RoundingPolicy(currency_scale=2, intermediate_scale=8),
state=PublicationState.DRAFT,
created_at=datetime(2026, 8, 26, tzinfo=UTC),
provenance={"source": "provider-rate-sheet-2026"},
)
cost.create_rate_card(draft)
validated = cost.validate_rate_card(draft.rate_card_id, 1, expected_revision=1)
published = cost.publish_rate_card(
draft.rate_card_id,
1,
expected_revision=validated.revision,
)
Lifecycle changes append immutable snapshots. Draft pricing can be replaced with optimistic revision checks; once validated, pricing is frozen. A correction uses a new rate-card version and an explicit supersession reference. Physical deletion is deliberately unsupported; retirement is the V1 delete semantic.
Calculate from released Usage aggregates
from meridian_storage.plugins.cost import CostCalculator, RepositoryUsageProvider
usage_provider = RepositoryUsageProvider(released_usage.repository)
calculator = CostCalculator(usage_provider, cost)
result = calculator.calculate(
scope={"tenant": "acme", "environment": "prod"},
start=start,
end=end,
rate_card=published.ref,
occurred_at=end,
)
The calculation requires closed Usage aggregates and records their exact aggregate versions, fingerprints, rate-card fingerprint, allocation fingerprint, calculator version, Decimal rounding stages, explanation tree, and supersession chain. Identical inputs replay the existing result; changed inputs create a new calculation revision.
Contracts and evidence
The wheel ships Cost Schemas, plugin/schema-provider entry points, a Usage compatibility matrix,
locked design revisions, JSON Schema compatibility evidence, and deterministic golden values.
Optional MeridianEvidenceSink emits audit and lineage records through the registered evidence
Catalog public Expression surface.
See architecture, rate cards, calculation, integration, and conformance.
Licensed under the Apache License, Version 2.0.
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 meridian_plugin_cost-1.0.0.tar.gz.
File metadata
- Download URL: meridian_plugin_cost-1.0.0.tar.gz
- Upload date:
- Size: 57.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db89a7426221d64d70f141cb3beb062f461370b99d6397969471b6c5bbe6ebb8
|
|
| MD5 |
e91a27d9d54acfa730e9dbd4a9dd1f10
|
|
| BLAKE2b-256 |
b0bf0d235ac9a7c53b63062e740624f7cec3a908d8487abb9b46e50e0d5ce147
|
Provenance
The following attestation bundles were made for meridian_plugin_cost-1.0.0.tar.gz:
Publisher:
release.yml on zephytiju/MeridianPluginCost
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
meridian_plugin_cost-1.0.0.tar.gz -
Subject digest:
db89a7426221d64d70f141cb3beb062f461370b99d6397969471b6c5bbe6ebb8 - Sigstore transparency entry: 2611399978
- Sigstore integration time:
-
Permalink:
zephytiju/MeridianPluginCost@d821ee6fd694e8abaf2f472c39cc49c836192ea7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/zephytiju
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d821ee6fd694e8abaf2f472c39cc49c836192ea7 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file meridian_plugin_cost-1.0.0-py3-none-any.whl.
File metadata
- Download URL: meridian_plugin_cost-1.0.0-py3-none-any.whl
- Upload date:
- Size: 43.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e86890490b0cd3dd924221bf715fc14967146e122968d2fa4f3b9fdfb99bd47
|
|
| MD5 |
3e5765b70c9ed30a130a6aa0b8e0205b
|
|
| BLAKE2b-256 |
9c7ee443d5e656745c9c985b2ecd9a10ca65d31e107a756453517e9710b2bcde
|
Provenance
The following attestation bundles were made for meridian_plugin_cost-1.0.0-py3-none-any.whl:
Publisher:
release.yml on zephytiju/MeridianPluginCost
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
meridian_plugin_cost-1.0.0-py3-none-any.whl -
Subject digest:
2e86890490b0cd3dd924221bf715fc14967146e122968d2fa4f3b9fdfb99bd47 - Sigstore transparency entry: 2611400922
- Sigstore integration time:
-
Permalink:
zephytiju/MeridianPluginCost@d821ee6fd694e8abaf2f472c39cc49c836192ea7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/zephytiju
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d821ee6fd694e8abaf2f472c39cc49c836192ea7 -
Trigger Event:
workflow_dispatch
-
Statement type: