Skip to main content

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. The keys go under [source.dbt.connection]. Prumi never takes a password in prumi.toml: put it in an environment variable and name that variable in password_env.

[source.dbt.connection]
type = "postgres"
host = "db.internal"
dbname = "analytics"
user = "prumi_reader"
password_env = "WAREHOUSE_PASSWORD"

If the variable password_env names is unset or empty, the server stops at startup. Without password_env, Prumi connects without a password. Every key is in Configuration.

Settings as text

The adapter's settings may arrive as text: Prumi reads every setting from PRUMI__… environment variables too (Settings from environment variables), and a variable's value is a string. The adapter converts its own settings, so port = "5433" works like port = 5433. An unknown key in [source.dbt] or [source.dbt.connection] stops the server, naming the key.

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, and metrics: 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.

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.prumi still 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 prumi key: meta is dbt's free-form dictionary for other tools, and dbt itself ignores it. Several tools read keys like meta.format with 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 the prumi key) 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.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prumi-adapter-dbt 0.3.0
File Size Uploaded Provenance Actions
prumi_adapter_dbt-0.3.0.tar.gz 39.3 kB Without provenance Details for prumi_adapter_dbt-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for prumi-adapter-dbt 0.3.0
File Interpreter ABI Platform Actions
prumi_adapter_dbt-0.3.0-py3-none-any.whl Python 3 none any Details for prumi_adapter_dbt-0.3.0-py3-none-any.whl

Total release size: 66.6 kB

Release files / prumi_adapter_dbt-0.3.0.tar.gz

Download URL prumi_adapter_dbt-0.3.0.tar.gz
Size 39.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d7bc43289bdd5e8a7bd417a55dde3ab2153d929ab5ba56e8f087d376ca6fd00f
BLAKE2b-256 checksum
How to use checksums
534073b3f2206baa5e7173e70002e894cc54d82a3533ab56a5be5cd336ff2fcb
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.3.0-py3-none-any.whl

Download URL prumi_adapter_dbt-0.3.0-py3-none-any.whl
Size 27.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e089d67d0e1d34917f14f767ac87dee6e96bc36ce24d3aba55f52f4ae3a65d2
BLAKE2b-256 checksum
How to use checksums
05f8b8397d1ee55362921dcd154649d7b71fbcc0b1c6b25e0666669cc65d2cde
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.3.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.

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