Fabric PBI Client
Python client for the Microsoft Fabric REST API.
Install
pip install fabric-pbi
Quick start
from fabricpandas import FabricClient
client = FabricClient()
workspaces = client.list_workspaces()
Example .env for quick start:
FABRIC_ACCESS_TOKEN=your_access_token_here
Authentication
Authentication is loaded from a .env file (default) or your shell. You can:
- Provide a bearer token directly, or
- Use service principal credentials to request a token via MSAL, or
- Use interactive login via system browser.
Option 1: Access token
Set an access token as an environment variable:
FABRIC_ACCESS_TOKEN(preferred if you already have a token), ortenant_id,client_id,client_secret(service principal)
Example .env:
FABRIC_ACCESS_TOKEN=your_access_token_here
Option 2: Service principal (MSAL)
Set your Azure AD app credentials in .env:
tenant_id=your_tenant_id
client_id=your_client_id
client_secret=your_client_secret
The client will request a token for:
https://analysis.windows.net/powerbi/api/.default
Install MSAL if you use service principal auth:
pip install msal
Option 3: Interactive login (system browser)
Configure a public client app in Azure AD and add a redirect URI of http://localhost.
Set your app and tenant IDs in .env:
tenant_id=your_tenant_id
client_id=your_client_id
Usage:
from fabricpandas import FabricClient
client = FabricClient(interactive_login=True)
Or request a token directly:
from fabricpandas.auth import get_fabric_token_interactive
token = get_fabric_token_interactive()
Custom .env path
Pass a custom env file path when constructing the client:
from fabricpandas import FabricClient
client = FabricClient(env_file="path/to/.env")
Troubleshooting auth
Missing required environment variables: setFABRIC_ACCESS_TOKENor all oftenant_id,client_id,client_secret.Missing required environment variables for interactive login: settenant_idandclient_idand ensure your app is a public client withhttp://localhostredirect URI.msal library is required: install MSAL withpip install msal.Failed to acquire token: verify Azure AD app credentials and that the app has access to Fabric APIs.
Metadata
Release files for fabric-pbi 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fabric_pbi-1.0.0.tar.gz | 16.5 kB | Without provenance | Details for fabric_pbi-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fabric_pbi-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for fabric_pbi-1.0.0-py3-none-any.whl |
Total release size: 40.0 kB
Release files / fabric_pbi-1.0.0.tar.gz
| Download URL | fabric_pbi-1.0.0.tar.gz |
|---|---|
| Size | 16.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eaa06b4c6942893b978f91f06ce8310a3ba824c4222b21e5b89abbd9a61f7061
|
|
BLAKE2b-256 checksum How to use checksums |
7cd183091c8b2957d744eaf9d0823045bfbebe71d94628a37dfbf5afa0450cdb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.9
|
Release files / fabric_pbi-1.0.0-py3-none-any.whl
| Download URL | fabric_pbi-1.0.0-py3-none-any.whl |
|---|---|
| Size | 23.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
88ab4cbf1d69d6b03ac2955fe360beab6c8f6d2671772bed9513415ac917e8f5
|
|
BLAKE2b-256 checksum How to use checksums |
84757023fc4f9f3e7a570fe2bac1441ee242d574d0aaff474ab076aa36e24d43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.9
|
Security for fabric-pbi 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.