Metadata-Version: 2.5
Name: fineprint
Version: 0.8.7
Summary: Read the fine print of your metrics — a decompiler for your dashboards: column-level lineage x LLM over dbt artifacts, evidence-bound caliber cards
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: data-governance,dbt,lineage,metrics,semantic-layer,sqlglot
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Database
Requires-Python: >=3.10
Requires-Dist: pyyaml>=6.0
Requires-Dist: requests>=2.28
Requires-Dist: sqlglot<32,>=30
Provides-Extra: demo
Requires-Dist: dbt-duckdb; extra == 'demo'
Requires-Dist: duckdb; extra == 'demo'
Requires-Dist: faker; extra == 'demo'
Requires-Dist: fastapi; extra == 'demo'
Requires-Dist: numpy; extra == 'demo'
Requires-Dist: pandas; extra == 'demo'
Requires-Dist: uvicorn[standard]; extra == 'demo'
Provides-Extra: dev
Requires-Dist: httpx; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Description-Content-Type: text/markdown

# fineprint

**Read the fine print of your metrics. A decompiler for your dashboards.**

从 dbt 项目的编译产物(manifest / catalog / compiled SQL)逆向合成每个指标的
完整技术口径——零数据库连接。读懂指标的小字条款,给看板的反编译器。

Reverse-engineers the full technical caliber of every metric from your dbt
artifacts (manifest / catalog / compiled SQL) — zero database connection.

- **字段级血缘图 column-level lineage**:跨模型、进 CTE/子查询/UNION/PIVOT,
  条件与聚合语义一并入图。
- **口径卡 caliber cards**:确定性公式组合器(发布权威)× LLM 解读(解释与
  叙述)双通道互证,每个事实带机器证据;组合器不可证时 LLM 兜底并标注原因。
  在 5 个公开真实项目(34,499 列)上组合器覆盖 99.7%,残余全部具名。
- **口径漂移检测 caliber drift**:图快照逐语义点比对,SQL 改动落到受影响
  指标与条件粒度。

```bash
pip install fineprint

fineprint init  --project <dbt 项目目录>   # 生成 fineprint.yml 模板
fineprint graph --project DIR              # 建血缘图(需先 dbt compile + docs generate)
fineprint synth --project DIR              # 合成口径卡(需配置 LLM 端点)
fineprint drift --project DIR              # 漂移检测
```

命令与 import 名统一为 `fineprint`(0.8.4 起)。
LLM 端点经环境变量或项目根 `.env` 配置(`FINEPRINT_LLM_BASE_URL` /
`FINEPRINT_LLM_API_KEY` / `FINEPRINT_LLM_MODEL`),兼容 OpenAI 风格 API;
`graph` / `trace` / `drift` 零 LLM 即可用。

无 catalog 也能跑(列 schema 由 yml 声明 + 编译 SQL 拓扑推断补全);能执行
`dbt docs generate` 时仍建议补上,实测列集更可靠。

**Roadmap**(暂未随本发行版打包):重复指标治理 `fineprint govern`(指纹扫描 +
LLM 仲裁)、dbt exposures 集成(指标候选预填 + 看板消费方标注)、非 dbt SQL 管道。

License: Apache-2.0
