PBIXRay
Overview
PBIXRay is a Python library designed to parse and analyze PBIX files, which are used with Microsoft Power BI. This library provides a straightforward way to extract valuable information from PBIX files, including tables, metadata, Power Query code, and more.
Installation
Before using PBIXRay, ensure you have the following Python modules installed: apsw, kaitaistruct, and pbixray. You can install them using pip:
pip install pbixray
Getting Started
To start using PBIXRay, import the module and initialize it with the path to your PBIX file:
from pbixray import PBIXRay
model = PBIXRay('path/to/your/file.pbix')
Features and Usage
Tables
To list all tables in the model:
tables = model.tables
print(tables)
Metadata
To get metadata about the Power BI configuration used during model creation:
metadata = model.metadata
print(metadata)
Power Query
To display all M/Power Query code used for data transformation, in a dataframe with TableName and Expression columns:
power_query = model.power_query
print(power_query)
Model Size
To find out the model size in bytes:
size = model.size
print(f"Model size: {size} bytes")
DAX Calculated Tables
To view DAX calculated tables in a dataframe with TableName and Expression columns:
dax_tables = model.dax_tables
print(dax_tables)
DAX Measures
To access DAX measures in a dataframe with TableName, Name, Expression, DisplayFolder, and Description columns:
dax_measures = model.dax_measures
print(dax_measures)
Schema
To get details about the data model schema and column types in a dataframe with TableName, ColumnName, and PandasDataType columns:
schema = model.schema
print(schema)
Get Table Contents
To retrieve the contents of a specified table:
table_name = 'YourTableName'
table_contents = model.get_table(table_name)
print(table_contents)
Statistics
To get statistics about the model, including column cardinality and byte sizes of dictionary, hash index, and data components, in a dataframe with columns TableName, ColumnName, Cardinality, Dictionary, HashIndex, and DataSize:
statistics = model.statistics
print(statistics)
Metadata
Release files for pbixray 0.1.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pbixray-0.1.14.tar.gz | 76.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pbixray-0.1.14-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 156.7 kB
Release files / pbixray-0.1.14.tar.gz
| Download URL | pbixray-0.1.14.tar.gz |
|---|---|
| Size | 76.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4f1b25738ef955174260ef7c676f525cb306e66066379f10191636a7246b55f9
|
|
BLAKE2b-256 checksum How to use checksums |
af87cfc70e1eb2cb75f37f9145a99574518734324f8c9dc6d7b72debe141e016
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.2
|
Release files / pbixray-0.1.14-py3-none-any.whl
| Download URL | pbixray-0.1.14-py3-none-any.whl |
|---|---|
| Size | 80.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b84a2f7f838ec29bafbf7996dd2b790f874f1e541604fc0e9d5504bc4ccaddb
|
|
BLAKE2b-256 checksum How to use checksums |
70d62b02c58f9eb75f8ee115bbdc217290f051f83e40d6dbc7020df244e8b16a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.2
|