Skip to main content

PBIXRay

Read Power BI semantic models without Power BI.

PyPI Downloads Python License: MIT

No Power BI Desktop. No Analysis Services instance. No XMLA endpoint, no Premium capacity, no workspace, no restore. Just a file path.

from pbixray import PBIXRay

model = PBIXRay("sales.pbix")

model.dax_measures         # every measure, as a DataFrame
model.relationships        # the full model graph
model.power_query          # all M code
model.get_table("Sales")   # actual decoded rows

PBIXRay is a Python reader for the VertiPaq engine's on-disk format. It parses .pbix files, .abf Analysis Services backups and .xlsx PowerPivot workbooks, which are three containers around the same storage engine, and returns pandas DataFrames. Read-only, offline, cross-platform, with no Microsoft runtime involved at any stage.

Every other way to inspect a model needs something running. Desktop open, a server connected, a backup restored, a capacity licensed. PBIXRay needs a file.


Install

pip install pbixray

Python 3.8 through 3.13, on macOS, Linux and Windows. Prebuilt wheels, so there is nothing to compile.


What you can pull out

Model logic measures, calculated columns, calculated tables, calculation groups
Transformations Power Query / M, M parameters, DataMashup queries (DirectQuery and native SQL)
Structure tables, columns, schema, relationships, hierarchies, perspectives, aggregations
Security row-level security, object-level security, roles and role memberships
Storage per-column cardinality, dictionary / hash-index / data sizes, total model size
Data decoded table contents, whole or streamed in chunks
Everything else all 40 $System.TMSCHEMA_* DMVs

Full reference and examples at pbixray.com/docs.


Three formats, one API

File type is detected from the contents, so the same code works across all three.

Input What it is
.pbix Power BI Desktop file
.abf Analysis Services backup, readable without provisioning a server or restoring
.xlsx Excel workbook with an embedded PowerPivot model
PBIXRay("report.pbix")
PBIXRay("nightly-backup.abf")
PBIXRay("legacy-powerpivot.xlsx")

ABF support turns a backup archive into something queryable without a restore. That covers retention audits, migration inventories, and answering "what was in this model in 2019" without standing anything up.


The 40 DMVs, from a file

Analysis Services exposes model metadata through $System.TMSCHEMA_* DMVs, normally reachable only over a live connection. PBIXRay reads all forty straight from the embedded metadata database.

model.tmschema_refresh_policies    # incremental refresh configuration
model.tmschema_role_memberships    # who is in which security role
model.tmschema_column_permissions  # object-level permissions
model.tmschema_partitions          # partition definitions and sources
All 40 endpoints

tmschema_model · tmschema_tables · tmschema_columns · tmschema_partitions · tmschema_hierarchies · tmschema_levels · tmschema_datasources · tmschema_perspectives · tmschema_perspective_tables · tmschema_perspective_columns · tmschema_perspective_hierarchies · tmschema_perspective_measures · tmschema_kpis · tmschema_annotations · tmschema_extended_properties · tmschema_cultures · tmschema_translations · tmschema_linguistic_metadata · tmschema_query_groups · tmschema_calculation_groups · tmschema_calculation_items · tmschema_calculation_expressions · tmschema_variations · tmschema_attribute_hierarchies · tmschema_sets · tmschema_refresh_policies · tmschema_detail_rows_definitions · tmschema_format_string_definitions · tmschema_functions · tmschema_calendars · tmschema_calendar_column_groups · tmschema_calendar_column_refs · tmschema_alternate_of · tmschema_related_column_details · tmschema_group_by_columns · tmschema_binding_info · tmschema_analytics_ai_metadata · tmschema_data_coverage_definitions · tmschema_role_memberships · tmschema_column_permissions

This makes governance tooling possible in places a live connection is not available. A pull request, a Lambda function, an air-gapped audit, a laptop with no license.


Models bigger than your RAM

Decompressed models are memory-mapped from disk rather than loaded whole, and tables stream by VertiPaq segment. Column projection and categorical strings cut memory further.

with PBIXRay("20gb-model.pbix", on_disk=True) as model:
    for chunk in model.iter_table("FactSales", chunk_size=1_000_000):
        process(chunk)

Dictionary decoding runs on a native Huffman kernel (xmhuffman) and fans out across cores.


Built on PBIXRay

🖥️ PBIXRay for macOS

A native model inspector for Mac. Open a .pbix and browse tables, measures, relationships and storage statistics, with no Windows VM, no Parallels and no Power BI Desktop. It streams one table at a time, so models too large for memory open fine. Spotlight integration finds measures by name.

Built for the Mac-based BI consultants Microsoft has never shipped a tool for.

🌐 pbix.info

Drop a model into the browser and explore it straight away. Metadata only, with no data or statistics extracted, focused on data origin and Power Query lineage. Nothing to install.

🦆 DuckDB extension

Query PBIX files directly in SQL.


Scope

PBIXRay is a read-only extractor for the data model. It does not:

  • write, modify or repack files
  • evaluate DAX, so expressions come back as source text
  • run a query engine
  • connect to Power BI Service, Analysis Services, gateways or workspaces
  • refresh anything
  • parse the report layer, meaning visuals, pages, bookmarks and themes
  • support .pbit, .pbids or .pbip

Read-only is a deliberate choice. A library that cannot write to a model also cannot corrupt one, which is what makes it safe to point at production artifacts and client files.


Contributing

The PBIX format is undocumented and reverse-engineered, so the test corpus is the specification. The most valuable contribution is a model that parses incorrectly.

If you find one, open an issue with the failure output and the structural details, such as encoding type, column metadata and offsets. Please never send file contents you do not own. A minimal reproduction is more useful than a real model and safer for everyone.


Built on

Decompression uses Microsoft's own MIT-licensed Xpress reference implementations, wrapped for Python as xpress8 and xpress9. Huffman dictionary decoding lives in xmhuffman. All three are kept in separate repositories so the Cython build and wheel distribution stay out of the main library.


Links

Documentation · Interactive demo · PyPI · Support

MIT licensed. Built in London by Alphaverse Limited.

Not affiliated with or endorsed by Microsoft. Power BI, Excel and Analysis Services are trademarks of Microsoft Corporation.

Download files

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

Source Distribution

pbixray-0.15.5.tar.gz (116.4 kB view details)

Uploaded Source

Built Distribution

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

pbixray-0.15.5-py3-none-any.whl (87.3 kB view details)

Uploaded Python 3

File details

Details for the file pbixray-0.15.5.tar.gz.

File metadata

  • Download URL: pbixray-0.15.5.tar.gz
  • Upload date:
  • Size: 116.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pbixray-0.15.5.tar.gz
Algorithm Hash digest
SHA256 cc4c99e1dafb4e460149b5f236d77cecf20ddd51080ad1db0b2d51e0450cd860
MD5 7d3e22fec3a003c593bebb397bf3b638
BLAKE2b-256 1e53d0fb2d832064b371d3ca23ecb0eb6348a95d71666c10c1561068138efd5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pbixray-0.15.5.tar.gz:

Publisher: publish.yml on Hugoberry/pbixray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pbixray-0.15.5-py3-none-any.whl.

File metadata

  • Download URL: pbixray-0.15.5-py3-none-any.whl
  • Upload date:
  • Size: 87.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pbixray-0.15.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e0e9695eb2eee1e8109586239324403fe363f1b2a0d380c270f074ec7cec7913
MD5 4579a0c1e83fc76307da33b8f6c02cec
BLAKE2b-256 1d397f3a976eb8a7963f03b28216b7c3bed2719611322462861809877ff4caba

See more details on using hashes here.

Provenance

The following attestation bundles were made for pbixray-0.15.5-py3-none-any.whl:

Publisher: publish.yml on Hugoberry/pbixray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.15.5 This release

2 files

0.15.4

2 files

0.15.3

2 files

0.15.2

2 files

0.15.1

2 files

0.15.0

2 files

0.13.0

2 files

0.12.0

2 files

0.11.1

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.3

2 files

0.3.2

2 files

0.2.1

2 files

0.1.21

2 files

0.1.20

2 files

0.1.19

2 files

0.1.18

2 files

0.1.17

2 files

0.1.16

2 files

0.1.15

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page