A package to fetch and save Power BI tables via XMLA endpoint
Project description
Power BI XMLA Endpoint Download to Parquet
This package allows you to fetch and save Power BI tables in Parquet format via the XMLA endpoint.
System Requirements
This package requires a Windows environment with .NET assemblies, as it relies on pythonnet
to interact with .NET libraries.
Authentication
The package currently only supports authentication using the Microsoft Authentication Library (MSAL) to obtain an access token, supporting Multi-Factor Authentication (MFA).
Python Version Requirement
This package requires Python version >=3.9,<3.13.
Installation
Using Poetry
To install the package using Poetry, run:
poetry add download_pbi_xmla
Using pip
To install the package using pip, run:
pip install download_pbi_xmla
Setup
-
Copy the example environment and config files: cp .env.example .env cp config.example.json config.json
-
Edit the .env and config.json files with your credentials and configuration.
.env File Example
CLIENT_ID=your-client-id CLIENT_SECRET=your-client-secret TENANT_ID=your-tenant-id CONFIG_FILE=config.json SAVE_PATH=./data
config.json File Example
{ "server": "your-server-url", "database": "your-database-name", "tables": [ { "name": "your-table-name", "refresh_type": "full", "date_column": "your-date-column", "last_date": "YYYY-MM-DD" } ] }
Usage
After setting up the environment and configuration files, you can use the download.py script to fetch and save Power BI tables in Parquet format.
Running the Script
You can run the script directly:
python download.py
Logging
Logs are saved in the logs directory with a timestamp. Both file and console logging are set up to capture the script's execution details.
Step-by-Step Instructions
- Install the Package:
Use Poetry to add the package to your project.
poetry add download_pbi_xmla
- Run the Setup Script: This script will copy example configuration files and prompt you to edit them.
python setup_files.py
- Edit Configuration Files: Update the copied .env and config.json files with your details.
.env File Example
Ensure the .env file is placed in the project directory and contains the following variables:
CLIENT_ID=your-client-id CLIENT_SECRET=your-client-secret TENANT_ID=your-tenant-id CONFIG_FILE=config.json SAVE_PATH=./data USE_MFA=true
config.json File Example
{ "server": "your-server-url", "database": "your-database-name", "tables": [ { "name": "your-table-name", "refresh_type": "full", "date_column": "your-date-column", "last_date": "YYYY-MM-DD" } ] }
- Run the Download Script: This script will load the environment variables and run the download process.
python run_download.py
Contribution
Feel free to fork the repository and create pull requests. Contributions are welcome!
For any issues or feature requests, please open an issue on the repository.
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
File details
Details for the file download_pbi_xmla-0.3.1.tar.gz
.
File metadata
- Download URL: download_pbi_xmla-0.3.1.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3db5276e89e7d13cde1baae78572bec7725c203e12462e4315587372025a706 |
|
MD5 | a227cc6190bb4d8c41aaafd210b4c4a5 |
|
BLAKE2b-256 | 6f964c10b75b750c25e647bc9847062872fdc9e5fcd9c1d85c4cb2881022c592 |
File details
Details for the file download_pbi_xmla-0.3.1-py3-none-any.whl
.
File metadata
- Download URL: download_pbi_xmla-0.3.1-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aea8966419e124f404f6ce64970afe54d390704f59e5092c37cb05c8c6a08e18 |
|
MD5 | ca951f4bb045f331a31de03e6263571d |
|
BLAKE2b-256 | 3add6032a0d8763d9f132afdc040ce0a825c5282292279566042ca2a392851f1 |