Create Power BI dashboards using python
Project description
Power Bpy 
Do you wish you could build dashboards with code, but can't because the client specifically asked for Power BI or your employer only supports publishing Power BI? Do you love Power BI, but wish there was a way to automatically generate parts of your dashboard to speed up your development process?
Introducing Power Bpy, a python package that lets you create Power BI dashboards using python. Dashboards created using these functions can be opened, edited and saved normally in Power BI desktop. Power Bpy uses the new .pbip/.pbir format which stores dashboards as directories of text files instead of binary files letting you version control your dashboards!
Not immediately convinced?
See some example dashboards or the use cases section below for more details about when you might use this package.
Features
Currently the package has functions that let you do the following without opening Power BI Desktop:
- Create new dashboards
- Import data from:
- Csv files stored locally
- Csv files stored in Azure Data Lake Storage (ADLS)
- Datasets stored as a Tabular Model Definition Language (TMDL) file
- Add new pages
- Add background images to a page
- Add visuals to a page:
- Get information about your dashboard:
- List pages attached to a dashboard
- List measures attached to a dashboard
- Load existing pages or dashboards into python so you can add pages, datasets, or visualizations
Dependencies
Before you can start to build power BI dashboards using this package's functions you'll need the following:
- Python 3.10+
- Power BI Desktop (You can create the dashboards without this, but not view them).
Power BI settings:
You'll need to enable some preview features in Power BI Desktop. Navigate to File > Options and Settings > Options > Preview features and enable the following options:
- Power BI Project (.pbip) save option
- Store Semantic Model using TMDL format
- Store reports using enhanced metadata format (PBIR)
Example Workflows
- For more details about how to install python and run python scripts, see the setup tutorial.
- To see an intro example of how to create dashboards using the package, see the test dashboard tutorial.
- To see more example dashboards and the scripts used to create them, see the example dashboards section of the website.
Publishing
The .pbip and .pbir formats can be tricky to publish to Power BI Service. See this guide for potential workarounds that let you continue publishing.
Use Cases
Q: Why would I use a python package to create dashboards instead of just creating dashboards/visualizations using python tools such as flask?
A: Many organizations only support certain tools for publishing. Power BI is often bundled with an organization's subscription to Microsoft. If your organization lets you use flask or react or whatever else, then this package probably won't be much use. If the only tool you are allowed to use to create and publish dashboards is Power BI, this package might help you build version controlled, reproducible and automated dashboard workflows using python instead of manually re-creating dashboards in Power BI desktop.
Q: I like Power BI because I don't have to write code to build dashboards. Why would I use this instead of Power BI Desktop?
A: You don't have to choose! Dashboards created with Power Bpy can be opened and edited normally in Power BI Desktop. You can use code when it makes sense and point-and-click tools when it doesn't.
Additionally, Power BI isn't actually a no-code tool because you have to learn DAX and M. This package give you the additional option of using python, (a language many people find easy to learn and use), for both data preparation and building dashboards.
You also don't have to be really good at python to use the functions in this package, see the test dashboard and example dashboards tutorials for examples of how easy it is to build dashboards with python!
Contributing
I welcome various types of feedback:
- Pull requests to add features, fix bugs, add tests, or improve documentation. If the change is a major change, create an issue first.
- Issues to suggest new features, report bugs, or tell me that the documentation is confusing.
- Power BI feature requests. I need help from Power BI developers who don't necessarily have experience with python or github, but who do know what Power BI features they'd like to see.
If possible it would be really helpful to show the change you want you by including a .pbix file that has the feature, or even better, before and after commits to GitHub of the dashboard showing the change. (Use the .pbip or .pbir format for the Github commits).
Sponsorship
Power Bpy is free and open-source, however if you found the package useful or inspiring, feel free to sponsor the project so that I can keep building it out. Additionally, I am a freelance software developer; if you would like to hire me to build out a custom Power Bpy workflow for your organization, please feel free to reach out to me on Linkedin or Bluesky.
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
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 powerbpy-0.2.0.tar.gz.
File metadata
- Download URL: powerbpy-0.2.0.tar.gz
- Upload date:
- Size: 7.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8025ffd476cd06d8ac0d8b47bd9ee86ddb4333ea7f14d635e3cfab75d5c56fb9
|
|
| MD5 |
117f5f27455b639dc0832b1dae4d5504
|
|
| BLAKE2b-256 |
54c064a6ddc3f1e0054229622bd97288cca8b0ba95f8749f849c3149ed378213
|
Provenance
The following attestation bundles were made for powerbpy-0.2.0.tar.gz:
Publisher:
python-publish.yml on Russell-Shean/powerbpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
powerbpy-0.2.0.tar.gz -
Subject digest:
8025ffd476cd06d8ac0d8b47bd9ee86ddb4333ea7f14d635e3cfab75d5c56fb9 - Sigstore transparency entry: 783784135
- Sigstore integration time:
-
Permalink:
Russell-Shean/powerbpy@ca9ee7caff5f7f831d478023ae1215c93cbeffad -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Russell-Shean
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@ca9ee7caff5f7f831d478023ae1215c93cbeffad -
Trigger Event:
release
-
Statement type:
File details
Details for the file powerbpy-0.2.0-py3-none-any.whl.
File metadata
- Download URL: powerbpy-0.2.0-py3-none-any.whl
- Upload date:
- Size: 81.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9197c1f9c0c17e7084cb74a8843fc068e91e3a1a822b71a13210b1f2e8c8ce3b
|
|
| MD5 |
65a84419bffaf96e842fec45389b7052
|
|
| BLAKE2b-256 |
e08665cf54af189884fd522cb4ba3b1ac3d436b6992367b5f7d6a0b3c741dbb7
|
Provenance
The following attestation bundles were made for powerbpy-0.2.0-py3-none-any.whl:
Publisher:
python-publish.yml on Russell-Shean/powerbpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
powerbpy-0.2.0-py3-none-any.whl -
Subject digest:
9197c1f9c0c17e7084cb74a8843fc068e91e3a1a822b71a13210b1f2e8c8ce3b - Sigstore transparency entry: 783784166
- Sigstore integration time:
-
Permalink:
Russell-Shean/powerbpy@ca9ee7caff5f7f831d478023ae1215c93cbeffad -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Russell-Shean
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@ca9ee7caff5f7f831d478023ae1215c93cbeffad -
Trigger Event:
release
-
Statement type: