{
  "markdown": "<h1 align=\"center\">\n<p>🌐 PBIX‑Atlas</p>\n</h1>\n\n<p align=\"center\">\n<a href=\"https://pypi.org/project/pbix-atlas/\">\n<img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/pbix-atlas?color=orange\">\n</a>\n<a href=\"https://github.com/fabienfrfr/pbix-atlas/\">\n<img alt=\"GitHub\" src=\"https://img.shields.io/badge/github-fabienfrfr%2Fpbix--atlas-black?logo=github\">\n</a>\n<a href=\"https://github.com/fabienfrfr/pbix-atlas/actions\">\n<img alt=\"CI\" src=\"https://img.shields.io/github/actions/workflow/status/fabienfrfr/pbix-atlas/tests.yml?label=tests\">\n<a href=\"https://registry.modelcontextprotocol.io/?q=pbix-atlas\">\n<img alt=\"MCP Registry\" src=\"https://img.shields.io/badge/MCP-registry-purple?logo=protocols\">\n</a>\n</p>\n\n<h3 align=\"center\">\n<p>Full lineage graph for Power BI — from source to visual field</p>\n</h3>\n\n<!-- mcp-name: io.github.fabienfrfr/pbix-atlas -->\n\n**PbixAtlas** is an Universal lineage graph for Power BI `.pbix` files: source to visual field in one traversable graph.\n\n```\nsource (HTTP, OData, SQL, file...) --> Power Query (M)\n    --> column / calculated column --> measure (DAX)\n        --> field displayed in a report visual\n```\n\n## Install\n\n```bash\npip install pbix-atlas\n# or\nuv add pbix-atlas\n```\n\n## Quick start\n\n```python\nfrom pbix_atlas import LineageGraphBuilder, upstream, downstream, print_tree, find_nodes\n\ngraph = LineageGraphBuilder().build(\"my_report.pbix\")\n\nfind_nodes(graph, \"customer_name\")\nprint_tree(graph, \"visual_field::my_report.pbix::Page1::16::customer_name\", direction=\"upstream\")\nprint_tree(graph, \"source::odata::example.com/odata/\", direction=\"downstream\")\n```\n\n## Export\n\n```python\nfrom pbix_atlas import export_graphml, export_nodes_csv, export_edges_csv, graph_summary\n\ngraph_summary(graph)  # {'query': 70, 'column': 183, ...}\nexport_graphml(graph, \"lineage.graphml\")  # Gephi / yEd\nexport_nodes_csv(graph, \"nodes.csv\")\nexport_edges_csv(graph, \"edges.csv\")\n```\n\n## Codegen — standalone Python pipeline\n\nGenerates 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).\n\n```bash\npip install \"pbix-atlas[codegen]\"\npbix-atlas-codegen my_report.pbix -o pipeline.py\n```\n\n```python\nfrom pbix_atlas import generate_python_pipeline\n\ngenerate_python_pipeline(\"my_report.pbix\", \"pipeline.py\")\n```\n\n## HTTP API / MCP server\n\n```bash\nuv sync --extra api\nuv run pbix-atlas    # http://127.0.0.1:8080\n```\n\n- REST: `POST /graphs`, `/search`, `/upstream`, `/downstream`, `/tree`, `/export`, `/codegen`\n- MCP (streamable HTTP): `http://127.0.0.1:8080/mcp/`\n- Env vars: `PBIX_LINEAGE_HOST`, `PBIX_LINEAGE_PORT`\n\n## Architecture\n\n| Module | Responsibility |\n|---|---|\n| `models.py` | Node/edge types and shared data structures |\n| `sources.py` | Physical source detection (configurable patterns) |\n| `pbix_model.py` | Adapter isolating from `pbixray` |\n| `m_lexer.py` / `m_parser.py` | Built-in M tokenizer and parser |\n| `m_interpreter.py` | M runtime interpreter + stdlib |\n| `dax_translate.py` | DAX → Python (supported subset) |\n| `dax.py` | DAX reference parsing |\n| `mquery.py` | Power Query dependencies (table-level) |\n| `layout.py` | Internal `Report/Layout` format parsing |\n| `graph_builder.py` | Orchestrator: builds the `networkx.DiGraph` |\n| `navigation.py` | Upstream/downstream traversal, search, export |\n| `codegen.py` | Python pipeline code generation |\n| `api/app.py` | FastAPI + MCP mount ([FastMCP](https://gofastmcp.com/)) |\n\n## Sample files\n\n- [Retail Analysis Sample PBIX](https://download.microsoft.com/download/9/6/D/96DDC2FF-2568-491D-AAFA-AFDD6F763AE3/Retail%20Analysis%20Sample%20PBIX.pbix) (Microsoft)\n- [Sales & Returns Sample v201912](https://github.com/microsoft/powerbi-desktop-samples/raw/refs/heads/main/Sample%20Reports/Sales%20%26%20Returns%20Sample%20v201912.pbix) (Microsoft)\n\n## Development\n\n```bash\nuv sync --extra dev\nuv run pytest\nuv build\n```\n",
  "bytes": 4036,
  "sha": "cb1df51169aa12511dcd2d486cdf7b80384bfc33daf34d0390fce193a34341a0",
  "repo_slug": "fabienfrfr/pbix-atlas",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_fabienfrfr_pbix_atlas_5b857f3b/readme"
}