Pbix Lineage

io.github.fabienfrfr由 GitHub 账号 fabienfrfr 发布v0.1.2更新于 Oct 24, 2026

Bidirectional data lineage graph for Power BI (.pbix) files, from source to display

概览

AI 生成的概览

为 Power BI .pbix 文件构建双向数据血缘图,从数据源经 Power Query 与 DAX 一直追踪到报表视觉对象。

可以做什么
将 .pbix 报表解析为可遍历的图,连接物理数据源(HTTP、OData、SQL、文件)、Power Query M、列与计算列、DAX 度量值,以及报表视觉对象中显示的字段。它提供搜索、上游与下游遍历、树状打印,并支持导出为 GraphML 以及节点/边 CSV。代码生成选项可生成复现报表链路的独立 Python 流水线,HTTP API 与 MCP 挂载则以 streamable HTTP 提供相同操作。
适用场景
当你需要理解或记录 Power BI 报表数字的来源、把某个视觉对象字段回溯到数据源,或查找某个数据源下游的所有内容时使用。它也适合把血缘导出到图分析工具,或从现有报表生成 Python 流水线。它不用于编辑报表或查询实时数据。
运行要求
作为本地进程在用户机器上运行,从 PyPI 安装(pbix-atlas),用 uvx 或 uv run pbix-atlas 启动。HTTP/MCP 模式需要 api 附加依赖,并绑定 PBIX_LINEAGE_HOST 与 PBIX_LINEAGE_PORT(默认显示为 127.0.0.1:8080)。代码生成需要 codegen 附加依赖。未声明账号、API 密钥或请求头。仅限桌面端,无网页可执行版本。
安装前请注意
代码生成功能会在内置解释器中于运行时执行 M 源码,因此只应对可信的 .pbix 文件使用。HTTP API 会绑定主机与端口(PBIX_LINEAGE_HOST、PBIX_LINEAGE_PORT),并提供读取报表文件、写出导出文件或生成流水线文件的接口;请保持在本机使用,不要暴露到不受信任的网络。未声明任何身份验证,能访问该端点的人都可以使用。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Pbix Lineage,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

🌐 PBIX‑Atlas

[PyPI] [GitHub] [CI] [MCP Registry]

Full lineage graph for Power BI — from source to visual field

PbixAtlas is an Universal lineage graph for Power BI .pbix files: source to visual field in one traversable graph.

source (HTTP, OData, SQL, file...) --> Power Query (M)    --> column / calculated column --> measure (DAX)        --> field displayed in a report visual

Install

bash
pip install pbix-atlas# oruv add pbix-atlas

Quick start

python
from pbix_atlas import LineageGraphBuilder, upstream, downstream, print_tree, find_nodes
graph = LineageGraphBuilder().build("my_report.pbix")
find_nodes(graph, "customer_name")print_tree(graph, "visual_field::my_report.pbix::Page1::16::customer_name", direction="upstream")print_tree(graph, "source::odata::example.com/odata/", direction="downstream")

Export

python
from pbix_atlas import export_graphml, export_nodes_csv, export_edges_csv, graph_summary
graph_summary(graph)  # {'query': 70, 'column': 183, ...}export_graphml(graph, "lineage.graphml")  # Gephi / yEdexport_nodes_csv(graph, "nodes.csv")export_edges_csv(graph, "edges.csv")

Codegen — standalone Python pipeline

Generates a single Python file reproducing a report's full chain: source → extraction → Power Query → semantic model → Vizro dashboard. The M source is executed at runtime by the built-in interpreter, not pattern-matched. Unimplemented functions raise MRuntimeError (no silent stubs).

bash
pip install "pbix-atlas[codegen]"pbix-atlas-codegen my_report.pbix -o pipeline.py
python
from pbix_atlas import generate_python_pipeline
generate_python_pipeline("my_report.pbix", "pipeline.py")

HTTP API / MCP server

bash
uv sync --extra apiuv run pbix-atlas    # http://127.0.0.1:8080
  • REST: POST /graphs, /search, /upstream, /downstream, /tree, /export, /codegen
  • MCP (streamable HTTP): http://127.0.0.1:8080/mcp/
  • Env vars: PBIX_LINEAGE_HOST, PBIX_LINEAGE_PORT

Architecture

ModuleResponsibility
models.pyNode/edge types and shared data structures
sources.pyPhysical source detection (configurable patterns)
pbix_model.pyAdapter isolating from pbixray
m_lexer.py / m_parser.pyBuilt-in M tokenizer and parser
m_interpreter.pyM runtime interpreter + stdlib
dax_translate.pyDAX → Python (supported subset)
dax.pyDAX reference parsing
mquery.pyPower Query dependencies (table-level)
layout.pyInternal Report/Layout format parsing
graph_builder.pyOrchestrator: builds the networkx.DiGraph
navigation.pyUpstream/downstream traversal, search, export
codegen.pyPython pipeline code generation
api/app.pyFastAPI + MCP mount (FastMCP)

Sample files

Development

bash
uv sync --extra devuv run pytestuv build

来源:README.md,提交 3b489b6

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.2最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。