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 分

    請在儲存庫或註冊中心條目中宣告授權條款。