Skip to main content

Universal lineage graph for Power BI (.pbix) files, from physical source to report display.

Project description

pbix-atlas

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

pip install pbix-atlas
# or
uv add pbix-atlas

Quick start

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

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 / yEd
export_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).

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

HTTP API / MCP server

uv sync --extra api
uv 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

Module Responsibility
models.py Node/edge types and shared data structures
sources.py Physical source detection (configurable patterns)
pbix_model.py Adapter isolating from pbixray
m_lexer.py / m_parser.py Built-in M tokenizer and parser
m_interpreter.py M runtime interpreter + stdlib
dax_translate.py DAX → Python (supported subset)
dax.py DAX reference parsing
mquery.py Power Query dependencies (table-level)
layout.py Internal Report/Layout format parsing
graph_builder.py Orchestrator: builds the networkx.DiGraph
navigation.py Upstream/downstream traversal, search, export
codegen.py Python pipeline code generation
api/app.py FastAPI + MCP mount (FastMCP)

Sample files

Development

uv sync --extra dev
uv run pytest
uv build

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pbix_atlas-0.2.0.tar.gz (48.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pbix_atlas-0.2.0-py3-none-any.whl (49.6 kB view details)

Uploaded Python 3

File details

Details for the file pbix_atlas-0.2.0.tar.gz.

File metadata

  • Download URL: pbix_atlas-0.2.0.tar.gz
  • Upload date:
  • Size: 48.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pbix_atlas-0.2.0.tar.gz
Algorithm Hash digest
SHA256 71ef8c4b20f3b490b7074a3215652c993e2ecbbbd05f367e933b510c69cc4c22
MD5 9fd0932a32c06bdbcfafb7838f9729bd
BLAKE2b-256 8381f463edf58b5ed0b36b74dd58887e1a15add9fb84e780eb2103b876c18444

See more details on using hashes here.

File details

Details for the file pbix_atlas-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pbix_atlas-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 49.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pbix_atlas-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c143970d42b55c0bf2b24b811731389761f785207e3902a7dc62b92da917712
MD5 3d89afe14b9fbc15456cca9415510a63
BLAKE2b-256 994007f9211cdb5e79fa373663974e1d9b2e480b7e44c6ed89618ced29ea91d4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page