Skip to main content

Parse Power BI PBIX files and generate a structured app plan.

Project description

riff-pbix

Parse Power BI .pbix files and generate a structured app plan.

Install

pip install riff-pbix

Quick start

import zipfile
from riff_pbix import (
    parse_report_layout,
    parse_data_model,
    parse_mashup,
    parse_connections,
    infer_model_from_references,
    build_lineage,
    generate_plan,
)

with zipfile.ZipFile("report.pbix") as z:
    layout = parse_report_layout(z)
    model = parse_data_model(z)
    mashup = parse_mashup(z)
    connections = parse_connections(z)

if not model or model.get("is_missing"):
    model = infer_model_from_references(layout.get("all_visuals_flat", []))

lineage = build_lineage(
    layout.get("all_visuals_flat", []),
    model,
    mashup.get("queries", []) if mashup else [],
)

analysis_result = {
    "filename": "report.pbix",
    "parsed_layout": layout,
    "parsed_model": model,
    "parsed_mashup": mashup,
    "connections": connections,
}

plan = generate_plan(analysis_result)
print(plan.json(indent=2))

CLI

Generate a plan JSON from a PBIX file:

riff-pbix path\to\report.pbix --pretty

Output the full analysis payload:

riff-pbix path\to\report.pbix --analysis --pretty

Write output to a file:

riff-pbix path\to\report.pbix --output report_plan.json --pretty

Notes

  • The parser reads the PBIX as a zip archive and extracts Report/Layout, DataModelSchema, DataMashup, and Connections when present.
  • If the model is missing, you can infer a lightweight model from visual usage.

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

riff_pbix-0.1.0.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

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

riff_pbix-0.1.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file riff_pbix-0.1.0.tar.gz.

File metadata

  • Download URL: riff_pbix-0.1.0.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for riff_pbix-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bf0b3bda9275eab93e198cfa8f8419a371a3b9353b6dd3c29ddc696a0c53ac17
MD5 0dfd9cb1dc74c39c3e24c21a4156d540
BLAKE2b-256 de1439c131aba01b4bb70e34abb7795b51be2e1366ec6a225db8a41208ad079b

See more details on using hashes here.

File details

Details for the file riff_pbix-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: riff_pbix-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for riff_pbix-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 692fbce12f7a4165b0a9bda28c9034741f1b5a3f4a0512362b85227484e95265
MD5 2bcbbca5ed17f3fb62d116788b43e39b
BLAKE2b-256 d3f6dcaa5998c74fc04c05fd5c3f93e0d60c58fa6880c115bdd26f3123ac90c1

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