Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Your help is appreciated. |
---|
This is a simple library that makes it easy to use the Power Bi REST API and Fabric REST API. We have cover more than 80% of PowerBi request and now we are working with Microsoft Fabric too. One day SimplePBI will contain all the categories in both APIs, our at least that's our vision dream. Feel free to check the doc to get a deeper understanding of a specific request:
We are doing our best to make this library useful for the community. This project is not a remunerable job for us. It's a public community open source project. It's a way to express our passion of sharing knowledge. Please be patient if you submit an issue and it's not fixed right away.
Each category is an Object. This means we need to initialize an object to start using its methods. In order to create them we need the Bearer token that can be obtain from a Token Object.
Let's see how we can create an Admin Object to try the requests in that category.
# Import library
from simplepbi import token
from simplepbi import admin
from simplepbi.fabric import adminfab
We always need to import token object to create the object to run requests. Then we can pick the object of the Power Bi Rest API category we need. For instance "admin". The token can be created in two ways, the regular authentication and the service principal one. It depends which one you pick to complete the request. These are the necessary arguments to get a token:
NOTE: if you want to use service principal, be sure to have your tenant ready for that.
Register app example: https://blog.ladataweb.com.ar/post/188045227735/get-access-token
Service Principal permissions for admin api: https://docs.microsoft.com/en-us/power-bi/admin/read-only-apis-service-principal-authentication
# Creating objects
#Regular Login
tok = token.Token(tenant_id, app_client_id, username, password, None, use_service_principal=False)
#Service Principal
tok = token.Token(tenant_id, app_client_id, None, None, app_secret_key, use_service_principal=True)
ad = admin.Admin(tok.token)
it = adminfab.Items(tok.token)
As you can see the Token object contains a token attribute with the Bearer used by Azure to run rest methods. That attribute will be user to create the category objects like admin. Once we create our Object like admin, we can start using the requests adding the correct parameters if they are needed.
# Getting objects
All_Datasets = ad.get_datasets()
Datasets_In_Groups = ad.get_datasets_in_group(workspace_id)
Items_In_Workspace = it.list_items(workspace_id)
The library get requests will return a response object .json() that python reads it as a Dict.
There are some methods in the classes that still need more testing. Those will have a "preview" at the end of the name. Please let us know if something goes wrong with those. All Fabric requests are in "preview" even though they don't have the clarification at the name.
Right now the library is consuming endpoints from:
If you want to get a deeper look on complex Admin methods and unique methods. Check this doc
We have added a new feature to include some Azure Resource API Manager. The new "azpause" class will let you Pause or Resume Azure tabular or capacity resources. With SimplePBI you can pause and resume Fabric, Power Bi Embedded or Azure Analysis Services resources. Check this doc
There an aditional library Utils for transformations. It is used to help some requests returning different values. The most useful method in the Utils class might be to_pandas. You can use the method to convert simple dicts to pandas. It needs the dict and the key father of a list of dicts in the response. The usual get responses are using "value" as the key. We are also adding new methods with the requests to help get new actions. Examples:
Small categories like Dataflow Storage Accounts and Available Features were moved to Groups and Admin.
We are still developing the library. The following endpoints from admin are still missing
Minor bug fixing for imports to read filesystem
Improving get activity events for single day after PowerBi updates. Adding new request to get last 30 days of activity logs automatically.
Adding update sources for datasets. It's a complex body request. Adding new unique request for publishing pbix file from azure devops repo. Changing pandas coding to work with 2.0.1 version. Fixing deprecated methods.
Adding newest admin request for getting tenant settings Adding new unique requests for pausing and resuming Fabric, Power Bi Embedded and Azure Analysis Services.
Adding dataset requests for scaleout. Update dataset to turn it on, get query sync and trigger query scale out sync.
Filtering Activity Events. The request methods for getting Activity Events for a single day or the last 30 days can now filter by user or activity.
Fixing request for importing powerbi desktop file from Azure DevOps.
Adding new request for importing pbix from GitHub (less 1Mb) like the one for DevOps. New Object category. Adding all Push Dataset category requests.
Adding support for GitHub pbix importing up to 100Mb.
Adding new cool features. Getting tables, measures, columns and roles from a dataset in a group (semantic model in workspace)
Adding Getting roles from a all datasets in a list of workspace or for a single workspace and dataset as admin. New autodocument feature. Create an html document by content or by tables from a semantic model at Datasets category.
Updating documentation adding definition of custom unique cool requests of our library.
New release and milestone completed. Our PowerBi backlog is mostly completed and we have added Fabric API. The Fabric categories involved are admin (adminfab) and core.
FAQs
Simplify usage of Power Bi Rest API
We found that SimplePBI demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.