pbip extractor helps to get an overview of all the variables used in a Power BI report.
Project description
pbip_extractor
pbip_extractor is a Python package designed to extract metadata and information from Power BI reports (pbip files). It helps in analyzing and understanding the components of Power BI reports, giving insights into which columns and measures are used in the report and where/how.
Installation
Install the package using pip:
pip install pbip_extractor
Usage
Import the package in your Python script or notebook:
from pbip_extractor import PbipExtractor
Extracting from a Report with a Data Model
For reports containing an embedded data model:
# initialize the extractor
pbip_path = "path/to/datamodel_dir/"
pbip_filename = "datamodel"
pbip = PbipExtractor(pbip_path=pbip_path,
pbip_filename=pbip_filename,
verbose=False,
)
# run the analysis
pbip.run()
# inspect the output
pbip.report_df.head()
pbip.column_in_report_df.head()
Extracting from a Report with a Live Connection
For reports using live connections to external data sources:
# report with the datamodel
# initialize the extractor
pbip_path_datamodel = "path/to/datamodel_dir/"
pbip_filename_datamodel = "datamodel"
datamodel_pbip = PbipExtractor(pbip_path=pbip_path,
pbip_filename=pbip_filename,
verbose=False,
)
# run the analysis
datamodel_pbip.run()
# extract the output needed as input in the next step
df_datamodel_overview = datamodel_pbip.report_df[['table', 'column']]
# report with live connection
# initialize the extractor
pbip_path_liveconn = "path/to/report_dir/"
pbip_filename_liveconn = "live connection report"
pbip_liveconn = PbipExtractor(pbip_path=pbip_path_liveconn,
pbip_filename=pbip_filename_liveconn,
df_source=df_datamodel_overview,
verbose=True,
)
# run the analysis
pbip_liveconn.run()
# inspect the output
pbip_liveconn.report_df.head()
pbip_liveconn.column_in_report_df.head()
Repository
The source code is available on GitLab.
Contributing
Contributions are welcome. Please fork the repository and submit merge requests on GitLab. For major changes, open an issue to discuss proposed modifications.
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pbip-extractor-0.1.0.tar.gz.
File metadata
- Download URL: pbip-extractor-0.1.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2d84d1b4a1eaf6eedfc2e46b04d28acb225ef520bc568babaf5cf950775b5ac
|
|
| MD5 |
2713076a84d2defcb4525f7735ac07f1
|
|
| BLAKE2b-256 |
42e6876d53cec2d0034b5fd9d4f169765d05a0e8fbbb9c33dfb02be284d76e11
|
File details
Details for the file pbip_extractor-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pbip_extractor-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a08cffbfa467269ab4094fd5af7d5e3a14f44ef0a1932729bb012672b887a8c
|
|
| MD5 |
539cf6db9ab332051f68746be371a39c
|
|
| BLAKE2b-256 |
4543a803fdc7843a1510c8eb992bcbf7965e1ed5167daa4d7063a6113136c5b8
|