Skip to main content

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

  1. Copy the example environment and config files: cp .env.example .env cp config.example.json config.json

  2. 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.

Example Workflow

Here’s an example workflow of how to use the package:

  1. Install the package using Poetry or pip.
  2. Copy and configure the .env and config.json files.
  3. Run the download.py script to fetch and save Power BI tables.

Script Overview

  • download_pbi_xmla/main.py: Contains the main functionality to fetch and save tables.
  • download.py: Script to execute the main functionality defined in main.py.

Command Syntax

The script fetches configuration from environment variables and the config file. There is no need to provide command-line arguments, making the usage straightforward.

Example Command

Simply run: python 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

download_pbi_xmla-0.3.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

download_pbi_xmla-0.3.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file download_pbi_xmla-0.3.0.tar.gz.

File metadata

  • Download URL: download_pbi_xmla-0.3.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Windows/11

File hashes

Hashes for download_pbi_xmla-0.3.0.tar.gz
Algorithm Hash digest
SHA256 53fcbb355cb3c3476280dc151fcac6a00de94aeb59d2f512ec343db93d663d1c
MD5 f1c666d82b145760bdcb59d0ef76a9fb
BLAKE2b-256 01a197c5095ac77b595ceb5d0cacd7b8b9f9e8a3a18736a99dd11389c405ff55

See more details on using hashes here.

File details

Details for the file download_pbi_xmla-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for download_pbi_xmla-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb9879279abb3eb297bb9a9b302c4c847cdaa758ac84046265c9a76e4280efc6
MD5 261edc69142a6c9634e3f0f3eca0d3b1
BLAKE2b-256 133c91b24e58657ff5e1c04565945fa9efb565e0dee2600294823e0d074a71c6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page