Skip to main content

FinePrint

Read the fine print of your metrics — a decompiler for your dashboards.

Source & issues · 中文文档 (Chinese docs)

FinePrint recovers, from your dbt project's compiled artifacts, what a metric actually executes — its true definition, in the small print of the SQL.

It can tell you:

  • how a metric's formula is computed;
  • where the numerator and the denominator each come from;
  • which filters, time windows and dedup rules shape the result;
  • which upstream columns the metric depends on;
  • whether a SQL change silently changed the metric's meaning.

FinePrint never connects to your database and never reads your business data.

Example

The dashboard says the refund rate is 3.93%. Finance computes 4.43% — half a point apart, and neither side can convince the other.

Walking the SQL chain reveals what the dashboard actually counts:

  • only refunds issued within 14 days of payment;
  • only the latest record of each refund;
  • test orders excluded;
  • paid orders only;
  • attributed to the payment date, not the refund date.

FinePrint unfolds those conditions, buried across multiple layers of SQL, directly:

$ fineprint trace --project . dm_refund_rate_1d.refund_rate

◎ dm.dm_refund_rate_1d.refund_rate
│  formula: SUM(refund_amount) / SUM(amount)
│
├─ numerator
│  ├─ refunded_at <= paid_at + INTERVAL '14' DAY
│  └─ rn = 1
│
├─ denominator
│  └─ from stg_orders
│
└─ shared by both sides
   ├─ status = 'paid'
   └─ is_test = 0

This definition tree is derived from the SQL by a deterministic program — no LLM involved.

Try it yourself in 10 minutes with the bundled example project — pre-built dbt artifacts included, no dbt install and no database needed. No checkout needed either: pip install fineprint && fineprint init --demo.

On a dashboard, every metric card becomes a definition entry — one click opens the full definition card:

Demo dashboard: every metric card carries a definition entry

The definition card: business clauses pinned to numbered evidence, a machine-proven formula, the lineage canvas and change history

(Demo dashboard — the demo warehouse's SQL is commented in Chinese, and with language: en the cards still synthesize in English. An animated tour lives in the repository README.)

Core capabilities

Metric definition tracing

Column-level lineage built on sqlglot, unfolding across models:

  • the formula;
  • numerator / denominator;
  • filter conditions;
  • time windows;
  • column dependencies.
fineprint graph --project .
fineprint trace --project . model.column

Metric definition cards

FinePrint runs two independent channels:

  • a deterministic engine deriving technical facts from the SQL AST;
  • an LLM reader producing a business-readable narrative.

The two are cross-validated before a traceable definition card is published.

fineprint synth --project .
fineprint report --project .

synth sends the relevant compiled SQL and column documentation to the LLM endpoint you configure; database credentials and warehouse data are never sent. Every other command runs entirely locally.

Definition drift detection

Detects:

  • formula changes;
  • filter changes;
  • time-window changes;
  • source-column and dependency changes;
  • the downstream metrics affected.
fineprint drift --project .

--strict makes it a CI gate.

Accuracy

The deterministic engine has been probed exhaustively on:

  • 5 public dbt projects;
  • 3 SQL dialects;
  • 1,364 models;
  • 34,499 columns.

Provable cross-layer formula coverage: 99.73%. (Coverage measures formula provability — it is not the same thing as the definition matching business intent.)

A hand-built suite of 14 classic metric-definition traps serves as regression: currently 14 / 14.

Install

Requires Python 3.10+.

pip install fineprint

Quick start

No dbt project handy? Start with the bundled example — no dbt, no database, no LLM key (a pre-built card batch ships with it):

fineprint init --demo && cd fineprint-quickstart

fineprint graph
fineprint trace dm_refund_rate_1d.refund_rate
fineprint report

On your own dbt project:

cd your-dbt-project

dbt compile
dbt docs generate

fineprint init --project .
fineprint graph --project .
fineprint columns --project .
fineprint trace --project . model.column

To generate definition cards:

export FINEPRINT_LLM_BASE_URL=https://api.openai.com/v1
export FINEPRINT_LLM_API_KEY=sk-...
export FINEPRINT_LLM_MODEL=gpt-4.1-mini

fineprint synth --project .
fineprint report --project .

After changing SQL:

dbt compile
fineprint graph --project .
fineprint drift --project .

graph, trace and drift never call an LLM.

Python API

Since 0.9, a minimal public surface for notebooks, BI plugins and orchestration:

import fineprint

fineprint.build_graph("path/to/dbt_project")
print(fineprint.trace("path/to/dbt_project", "dm_refund_rate_1d.refund_rate"))
batch = fineprint.cards("path/to/dbt_project")   # the card JSON is the contract (schema_version frozen)

Current boundaries

What FinePrint recovers is:

the definition your code actually executes.

It cannot judge on its own whether the SQL matches the business's original intent.

The current stable release targets dbt projects.

Documentation

License: Apache-2.0

Metadata

Release files for fineprint 0.9.8

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

Source distribution (sdist)

Source distribution for fineprint 0.9.8
File Size Uploaded Provenance Actions
fineprint-0.9.8.tar.gz 188.4 kB Without provenance Details for fineprint-0.9.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fineprint 0.9.8
File Interpreter ABI Platform Actions
fineprint-0.9.8-py3-none-any.whl Python 3 none any Details for fineprint-0.9.8-py3-none-any.whl

Total release size: 402.8 kB

Release files / fineprint-0.9.8.tar.gz

Download URL fineprint-0.9.8.tar.gz
Size 188.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2ea7a81d05745cb1ba2c75d2498fc67d0a596093ca7f9168e008a3381526b6c5
BLAKE2b-256 checksum
How to use checksums
0ff9b4be0a128592de2a5a3f54b06162e0b4af0bd3b28803a1d54dc90d9d76a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / fineprint-0.9.8-py3-none-any.whl

Download URL fineprint-0.9.8-py3-none-any.whl
Size 214.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49b5dfc1a88ca52594919fdee4f8a2769001ce8fa666b28e15dabba80c91da42
BLAKE2b-256 checksum
How to use checksums
661eb743e4a58c38a2f1574039b255bf337a50149c4d53d95ec2011c1f73b3a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for fineprint 0.9.8

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