Pbix Lineage

io.github.fabienfrfrPublished by GitHub account fabienfrfrv0.1.2Updated Oct 24, 2026

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

Overview

AI-generated overview

Builds a bidirectional data lineage graph for Power BI .pbix files, tracing sources through Power Query and DAX to report visuals.

What you can do
Parses a .pbix report into a traversable graph linking physical sources (HTTP, OData, SQL, files) through Power Query M, columns and calculated columns, DAX measures, and the fields shown in report visuals. It exposes search, upstream and downstream traversal, and tree printing, plus exports to GraphML and node/edge CSV. A codegen option generates a standalone Python pipeline reproducing a report's chain, and an HTTP API with an MCP mount offers the same operations over streamable HTTP.
When to use it
Use it when you need to understand or document where a Power BI report's numbers come from, trace a visual field back to its source, or find everything downstream of a source. It also suits exporting lineage into graph tools or generating a Python pipeline from an existing report. It is not for editing reports or querying live data.
Requirements
Runs as a local process on the user's machine, installed from PyPI (pbix-atlas) and started with uvx or uv run pbix-atlas. The HTTP/MCP mode needs the api extra and binds to PBIX_LINEAGE_HOST and PBIX_LINEAGE_PORT (default shown as 127.0.0.1:8080). Codegen needs the codegen extra. No accounts, API keys or headers are declared. Desktop only; no web executable.
Before you install
The codegen feature executes M source at runtime in a built-in interpreter, so only run it on .pbix files you trust. The HTTP API binds to a host and port (PBIX_LINEAGE_HOST, PBIX_LINEAGE_PORT) and exposes endpoints that read report files and write export or generated pipeline files; keep it on localhost and do not expose it to untrusted networks. No authentication is declared, so anyone who can reach the endpoint can use it.

Installation

In SourceWeft

  1. Open Pbix Lineage in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

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

Source: README.md at commit 3b489b6

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.1.2LatestSep 16, 2026

Score

40% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

    Declare a license in the repository or the registry entry.