prumi-adapter-dbt
Prumi adapter for dbt semantic models. MetricFlow compiles a semantic query into SQL for the warehouse; Prumi executes that SQL over its own connection; the warehouse enforces access rules.
Install it with Prumi: uv tool install "prumi[dbt]" installs both, with the DuckDB and Postgres drivers; the dbt-style pip install prumi "prumi-adapter-dbt[duckdb,postgres]" gives the same packages. Each driver is an extra of its own ([duckdb], [postgres]), so pip install prumi-adapter-dbt[postgres] brings only psycopg. Import name: prumi_adapter_dbt.
Connecting to Postgres
On Postgres, Prumi connects with its own role, separate from the one in your dbt profile, and every session is read-only. That role needs CONNECT on the database dbt built, USAGE on the schemas of the tables in the semantic manifest, and SELECT on those tables; Postgres applies its grants and row policies to every query. Prumi never takes a password in prumi.toml: libpq finds it in PGPASSWORD or ~/.pgpass (or a service file). The keys go under [source.dbt.connection]; see Configuration.
Preparing your dbt project
What Prumi reads
Prumi reads one file: target/semantic_manifest.json, which dbt parse (or any dbt command that parses the project) writes. It doesn't run dbt and doesn't need your dbt project folder. While the server runs, Prumi watches the file: a few seconds after dbt parse rewrites it, the new metrics are live. A manifest that fails the startup checks is logged and the old one stays in use.
For Prumi to show anything, the project needs:
semantic_models:with entities, dimensions and measures, andmetrics:built on them (dbt docs);- a time spine model, which MetricFlow requires for time grains.
Prumi shows your metrics as they are: names, labels, descriptions, types and valid dimensions all come from the manifest. It never copies or changes your definitions.
Display formats: add config.meta.prumi (recommended)
dbt's semantic layer describes how a metric is computed, but not how it should be displayed: it has no field saying that revenue is money in USD, or that gross_margin_pct is a fraction to show as a percentage. Without that, every dashboard guesses, and the same metric ends up as 0.25 on one page and 25% on another, or with currencies mixed on one chart.
Prumi takes formats from the metric definition so they're the same everywhere. We suggest adding them under config.meta.prumi on each metric:
metrics:
- name: revenue
label: Revenue
description: Net sales after discounts, in USD.
type: simple
type_params:
measure: revenue_amount
config:
meta:
prumi:
format: currency # number | integer | percent | currency
unit: USD # ISO 4217 code for currency; free text otherwise ("orders")
decimals: 2 # optional
owner: sales-analytics
| Key | Values | Meaning |
|---|---|---|
format |
number, integer, percent, currency |
percent means the value is a fraction: 0.25 shows as 25% |
unit |
ISO 4217 code for currency (USD, EUR, BRL); any text otherwise |
Required for currency. Prumi warns when one block mixes units |
decimals |
0–20 | Optional. Defaults: up to 2 for number, 0 for integer, 1 for percent, and the currency's usual digits for currency (2 for USD, 0 for JPY) |
- It's optional. A metric without
meta.prumistill works: it's shown as a plain number, and the validator warns that no format is declared (R10.no_format). An invalid entry is treated the same way. - Why under a
prumikey:metais dbt's free-form dictionary for other tools, and dbt itself ignores it. Several tools read keys likemeta.formatwith their own meanings, so Prumi keeps its settings in its own namespace to avoid clashes. - Owner: Prumi shows
config.meta.owner(a common convention, outside theprumikey) as the metric's owner when it's a string.
The demo project in examples/demo-dbt-project uses this convention on every metric except discount_rate, which is left without a format on purpose.
Dimension names
Prumi uses MetricFlow's names for dimensions (customer__region: the region of the customer entity). When MetricFlow can reach the same attribute through several join paths, Prumi shows only the shortest one for each metric, so agents don't see near-duplicates.
Metadata
Release files for prumi-adapter-dbt 0.2.0
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 |
|---|---|---|---|---|
| prumi_adapter_dbt-0.2.0.tar.gz | 36.5 kB | Without provenance | Details for prumi_adapter_dbt-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| prumi_adapter_dbt-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for prumi_adapter_dbt-0.2.0-py3-none-any.whl |
Total release size: 62.4 kB
Release files / prumi_adapter_dbt-0.2.0.tar.gz
| Download URL | prumi_adapter_dbt-0.2.0.tar.gz |
|---|---|
| Size | 36.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
36b23c9d32be8ffd75cbcc5b4c4bcb12133e179e3d6d65a498ff7a4a5b9a7f8d
|
|
BLAKE2b-256 checksum How to use checksums |
b149f5fa3abca456d226698725fdb1bd1107cb6482bf273a349a24a074036a60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / prumi_adapter_dbt-0.2.0-py3-none-any.whl
| Download URL | prumi_adapter_dbt-0.2.0-py3-none-any.whl |
|---|---|
| Size | 25.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d90f00af4a1be21894f44e2dd3aedfc01ecc57faf9ee3dc30b9aed93d7cf4c11
|
|
BLAKE2b-256 checksum How to use checksums |
fa83742dc6255cd5c52ccde3ac381b445236cb9ce1f199e5540c8f14777e17a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for prumi-adapter-dbt 0.2.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.