Skip to main content

yuppie-powerbi

Power BI REST API 客户端库(基于服务主体 + OAuth2 client_credentials),无 MCP 依赖

yuppie-mcp-powerbi 仓库拆出的纯 Python 库:如果你只想在自己的项目里调用 Power BI REST API / 执行 DAX 查询,不想引入 MCP 及其版本约束,直接用这个包。

安装

uv add yuppie-powerbi        # 或 pip install yuppie-powerbi

快速开始

from yuppie_powerbi import PowerBIClient, PowerBIConfig

config = (
    PowerBIConfig.from_env()
)  # 读 PB_TENANT_ID/PB_CLIENT_ID/PB_CLIENT_SECRET/PB_DATASET_ID 等环境变量
client = PowerBIClient(config)

result = await client.execute_dax(config.dataset_id, "EVALUATE VALUES('SITE'[SITE])")
print(result)

模块结构

  • yuppie_powerbi — 包根直接暴露 PowerBIClientPowerBIConfig
  • yuppie_powerbi.configPowerBIConfig 环境配置(服务主体凭据,from_env() 校验必填项)
  • yuppie_powerbi.clientPowerBIClient 异步客户端:token 获取(自动刷新缓存)、execute_dax()get_group_reports()
  • 无 mcp / pydantic 依赖(deps 仅 python-dotenv、httpx)

与 MCP Server 的关系

同一仓库的 packages/yuppie-mcp-powerbi 是本库的 MCP 壳(把 DAX 查询等封装为 MCP 工具),PyPI 分发(uvx yuppie-mcp-powerbi),依赖本包。两者版本独立演进。

依赖

Python ≥ 3.10;python-dotenv、httpx

Download files

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

Source Distribution

yuppie_powerbi-0.1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yuppie_powerbi-0.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file yuppie_powerbi-0.1.0.tar.gz.

File metadata

  • Download URL: yuppie_powerbi-0.1.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for yuppie_powerbi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c5a82722b065abb0ff395b9c7f2eae922b2094637ecfb9b33ea8883a2b9eac5e
MD5 716dfa1b32ba2791d6bee5294a7388f3
BLAKE2b-256 701beb4ddd1fe9bfc3c4333b6fdcbf6c2dec7ac1d38e17cbf6fb913a11496e3c

See more details on using hashes here.

File details

Details for the file yuppie_powerbi-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: yuppie_powerbi-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for yuppie_powerbi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 17b4d6c9be86e48dcb2f7c12ee6c4dd70fa024bead2e721121304b4666ffb6d3
MD5 458fccd86eb2193121f80e44e0a82dcd
BLAKE2b-256 e00ae55926ac920831c7c127ee7081a00db38e85962cb46d894783df45e5d950

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page