# hugoberry/pbixray architecture

> Architecture diagram of the GitHub repository hugoberry/pbixray, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hugoberry/pbixray
- Repository: https://github.com/hugoberry/pbixray

## Overview

PBIXRay is a read-only Python extractor for Power BI, Analysis Services backup, and PowerPivot model files. The principal workflow opens a model through PBIXRay, detects and unpacks its container, parses metadata and storage, then exposes model information and decoded table data as DataFrames or streamed chunks. Metadata branches into SQLite-backed models and XLSX/XML models; additional capabilities include Power Query extraction and model statistics. The README documents these outputs; some internal calls and decoder details are not shown in the sampled source, so uncertain links are omitted.

Main entry points: [`pbixray/core.py`](https://github.com/hugoberry/pbixray/blob/main/pbixray/core.py) (PBIXRay API), [`pbixray/loader.py`](https://github.com/hugoberry/pbixray/blob/main/pbixray/loader.py) (Container loader), [`pbixray/meta/metadata.py`](https://github.com/hugoberry/pbixray/blob/main/pbixray/meta/metadata.py) (Metadata facade), [`pbixray/meta/sqlite_source.py`](https://github.com/hugoberry/pbixray/blob/main/pbixray/meta/sqlite_source.py) (SQLite metadata)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Reader API"]
  node_pbixray["PBIXRay API<br/>[core.py]"]
  node_result["DataFrames / chunks"]
end

subgraph group_containers["Container Parsing"]
  node_loader["Container loader<br/>[loader.py]"]
  node_abfparser["ABF parser<br/>[parser.py]"]
  node_abfparts["ABF records"]
  node_mapped["Mapped buffers<br/>[mapped_buffer.py]"]
  node_connections["Connection manifest<br/>[connections.py]"]
end

subgraph group_metadata["Model Metadata"]
  node_metadata["Metadata facade<br/>[metadata.py]"]
  node_sqlite["SQLite metadata<br/>[sqlite_source.py]"]
  node_idfmeta["Column metadata parser<br/>[idfmeta.py]"]
  node_xmlmeta["XML metadata<br/>[xml_source.py]"]
  node_xldm["XML model objects"]
  node_mashup["Power Query decoder<br/>[qdeff.py]"]
  node_metadata_db[("Embedded metadata DB")]
end

subgraph group_data["Data Extraction"]
  node_decoder["VertiPaq decoder"]
  node_columnformats["Column storage formats"]
end

node_user(("Python caller"))

node_user -->|"opens file"| node_pbixray
node_pbixray -->|"loads container"| node_loader
node_loader -->|"parses ABF"| node_abfparser
node_abfparser -->|"reads records"| node_abfparts
node_loader -->|"maps data"| node_mapped
node_loader -->|"reads manifest"| node_connections
node_pbixray -->|"exposes metadata"| node_metadata
node_metadata -->|"selects source"| node_sqlite
node_metadata -->|"selects source"| node_xmlmeta
node_sqlite -->|"queries"| node_metadata_db
node_sqlite -->|"parses column metadata"| node_idfmeta
node_xmlmeta -->|"loads model objects"| node_xldm
node_pbixray -.->|"extracts M code"| node_mashup
node_pbixray -->|"decodes tables"| node_decoder
node_decoder -.->|"decodes storage"| node_columnformats
node_pbixray -->|"returns results"| node_result
node_metadata -->|"provides model views"| node_result

click node_pbixray "https://github.com/hugoberry/pbixray/blob/main/pbixray/core.py"
click node_loader "https://github.com/hugoberry/pbixray/blob/main/pbixray/loader.py"
click node_abfparser "https://github.com/hugoberry/pbixray/blob/main/pbixray/abf/parser.py"
click node_abfparts "https://github.com/hugoberry/pbixray/tree/main/pbixray/abf"
click node_mapped "https://github.com/hugoberry/pbixray/blob/main/pbixray/abf/mapped_buffer.py"
click node_connections "https://github.com/hugoberry/pbixray/blob/main/pbixray/connections.py"
click node_metadata "https://github.com/hugoberry/pbixray/blob/main/pbixray/meta/metadata.py"
click node_sqlite "https://github.com/hugoberry/pbixray/blob/main/pbixray/meta/sqlite_source.py"
click node_idfmeta "https://github.com/hugoberry/pbixray/blob/main/pbixray/column_data/idfmeta.py"
click node_xmlmeta "https://github.com/hugoberry/pbixray/blob/main/pbixray/meta/xml_source.py"
click node_xldm "https://github.com/hugoberry/pbixray/tree/main/pbixray/xldm"
click node_mashup "https://github.com/hugoberry/pbixray/blob/main/pbixray/mashup/qdeff.py"
click node_decoder "https://github.com/hugoberry/pbixray/blob/main/pbixray/vertipaq_decoder.py"
click node_columnformats "https://github.com/hugoberry/pbixray/tree/main/pbixray/column_data"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pbixray,node_result toneBlue
class node_loader,node_abfparser,node_abfparts,node_mapped,node_connections toneAmber
class node_metadata,node_sqlite,node_idfmeta,node_xmlmeta,node_xldm,node_mashup,node_metadata_db toneMint
class node_decoder,node_columnformats toneRose
class node_user toneIndigo
```

## Components

### Reader API

- [PBIXRay API](https://github.com/hugoberry/pbixray/blob/main/pbixray/core.py): `pbixray/core.py`
- **DataFrames / chunks**

### Container Parsing

- [Container loader](https://github.com/hugoberry/pbixray/blob/main/pbixray/loader.py): `pbixray/loader.py`
- [ABF parser](https://github.com/hugoberry/pbixray/blob/main/pbixray/abf/parser.py): `pbixray/abf/parser.py`
- [ABF records](https://github.com/hugoberry/pbixray/tree/main/pbixray/abf): `pbixray/abf`
- [Mapped buffers](https://github.com/hugoberry/pbixray/blob/main/pbixray/abf/mapped_buffer.py): `pbixray/abf/mapped_buffer.py`
- [Connection manifest](https://github.com/hugoberry/pbixray/blob/main/pbixray/connections.py): `pbixray/connections.py`

### Model Metadata

- [Metadata facade](https://github.com/hugoberry/pbixray/blob/main/pbixray/meta/metadata.py): `pbixray/meta/metadata.py`
- [SQLite metadata](https://github.com/hugoberry/pbixray/blob/main/pbixray/meta/sqlite_source.py): `pbixray/meta/sqlite_source.py`
- [Column metadata parser](https://github.com/hugoberry/pbixray/blob/main/pbixray/column_data/idfmeta.py): `pbixray/column_data/idfmeta.py`
- [XML metadata](https://github.com/hugoberry/pbixray/blob/main/pbixray/meta/xml_source.py): `pbixray/meta/xml_source.py`
- [XML model objects](https://github.com/hugoberry/pbixray/tree/main/pbixray/xldm): `pbixray/xldm`
- [Power Query decoder](https://github.com/hugoberry/pbixray/blob/main/pbixray/mashup/qdeff.py): `pbixray/mashup/qdeff.py`
- **Embedded metadata DB**

### Data Extraction

- [VertiPaq decoder](https://github.com/hugoberry/pbixray/blob/main/pbixray/vertipaq_decoder.py): `pbixray/vertipaq_decoder.py`
- [Column storage formats](https://github.com/hugoberry/pbixray/tree/main/pbixray/column_data): `pbixray/column_data`

### Other components

- **Python caller**

## Connections

- Python caller → PBIXRay API: opens file
- PBIXRay API → Container loader: loads container (evidence: `pbixray/core.py`)
- Container loader → ABF parser: parses ABF (evidence: `pbixray/loader.py`)
- ABF parser → ABF records: reads records (evidence: `pbixray/abf/parser.py`)
- Container loader → Mapped buffers: maps data (evidence: `pbixray/loader.py`)
- Container loader → Connection manifest: reads manifest (evidence: `pbixray/loader.py`)
- PBIXRay API → Metadata facade: exposes metadata (evidence: `pbixray/core.py`)
- Metadata facade → SQLite metadata: selects source (evidence: `pbixray/meta/metadata.py`)
- Metadata facade → XML metadata: selects source (evidence: `pbixray/meta/metadata.py`)
- SQLite metadata → Embedded metadata DB: queries (evidence: `pbixray/meta/sqlite_source.py`)
- SQLite metadata → Column metadata parser: parses column metadata (evidence: `pbixray/meta/sqlite_source.py`)
- XML metadata → XML model objects: loads model objects (evidence: `pbixray/meta/xml_source.py`)
- PBIXRay API → Power Query decoder: extracts M code
- PBIXRay API → VertiPaq decoder: decodes tables (evidence: `pbixray/core.py`)
- VertiPaq decoder → Column storage formats: decodes storage
- PBIXRay API → DataFrames / chunks: returns results
- Metadata facade → DataFrames / chunks: provides model views (evidence: `pbixray/meta/metadata.py`)
