pbi-enterprise-cli 0.1.0.dev2__tar.gz → 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pbi_enterprise_cli-1.0.0/PKG-INFO +123 -0
- pbi_enterprise_cli-1.0.0/README.md +316 -0
- pbi_enterprise_cli-1.0.0/README.pypi.md +60 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/pyproject.toml +42 -24
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/__init__.py +1 -1
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/backends/xmla_backend.py +4 -5
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/cli.py +103 -8
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/_doctor.py +3 -4
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/deploy.py +2 -2
- pbi_enterprise_cli-1.0.0/src/pbi_cli/commands/env_cmd.py +146 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/govern.py +50 -16
- pbi_enterprise_cli-1.0.0/src/pbi_cli/commands/server_cmd.py +74 -0
- pbi_enterprise_cli-1.0.0/src/pbi_cli/commands/skills_cmd.py +269 -0
- pbi_enterprise_cli-1.0.0/src/pbi_cli/commands/snapshot.py +166 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/source.py +3 -5
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/visual.py +2 -2
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/intelligence/measure_generator.py +1 -1
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/server/api.py +35 -16
- pbi_enterprise_cli-1.0.0/src/pbi_cli/server/auth.py +26 -0
- pbi_enterprise_cli-1.0.0/src/pbi_enterprise_cli.egg-info/PKG-INFO +123 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_enterprise_cli.egg-info/SOURCES.txt +3 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_enterprise_cli.egg-info/requires.txt +11 -11
- pbi_enterprise_cli-0.1.0.dev2/PKG-INFO +0 -102
- pbi_enterprise_cli-0.1.0.dev2/README.md +0 -326
- pbi_enterprise_cli-0.1.0.dev2/README.pypi.md +0 -46
- pbi_enterprise_cli-0.1.0.dev2/src/pbi_cli/commands/server_cmd.py +0 -30
- pbi_enterprise_cli-0.1.0.dev2/src/pbi_cli/commands/skills_cmd.py +0 -168
- pbi_enterprise_cli-0.1.0.dev2/src/pbi_enterprise_cli.egg-info/PKG-INFO +0 -102
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/LICENSE +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/setup.cfg +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/_audit.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/_snapshot.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/backends/__init__.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/backends/mock_backend.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/backends/pbir_backend.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/backends/protocol.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/backends/tom_backend.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/__init__.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/_shared.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/calendar_cmd.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/connections.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/custom_visual.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/database.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/dax.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/docs.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/filter_cmd.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/layout.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/measure.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/model.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/partition.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/repl.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/report.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/security.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/theme.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/trace.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/commands/watch.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/docs_gen/__init__.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/docs_gen/confluence.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/docs_gen/markdown.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/governance/__init__.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/governance/bpa.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/governance/engine.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/governance/rules/__init__.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/governance/rules/measure_brackets.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/governance/rules/measure_description.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/governance/rules/measure_format.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/governance/rules/measure_naming.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/governance/rules/table_pascal_case.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/intelligence/__init__.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/intelligence/layout_engine.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/intelligence/theme_generator.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/intelligence/visual_builder.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/intelligence/visual_recommender.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/server/__init__.py +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_enterprise_cli.egg-info/dependency_links.txt +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_enterprise_cli.egg-info/entry_points.txt +0 -0
- {pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_enterprise_cli.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pbi-enterprise-cli
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Full-stack Power BI automation CLI — XMLA/Fabric connectivity, Python-native BPA governance, semantic model management, DAX testing, PBIR authoring, and AI-powered measures
|
|
5
|
+
Author-email: Mudassir <mir.mudassir1@gmail.com>
|
|
6
|
+
Maintainer-email: Mudassir <mir.mudassir1@gmail.com>
|
|
7
|
+
License: MIT AND LicenseRef-Microsoft-AS-Client-Libraries
|
|
8
|
+
Project-URL: Homepage, https://github.com/mudassir09/pbi-enterprise-cli
|
|
9
|
+
Project-URL: Repository, https://github.com/mudassir09/pbi-enterprise-cli
|
|
10
|
+
Project-URL: Documentation, https://github.com/mudassir09/pbi-enterprise-cli#readme
|
|
11
|
+
Project-URL: Changelog, https://github.com/mudassir09/pbi-enterprise-cli/blob/main/CHANGELOG.md
|
|
12
|
+
Project-URL: Bug Tracker, https://github.com/mudassir09/pbi-enterprise-cli/issues
|
|
13
|
+
Project-URL: Security Policy, https://github.com/mudassir09/pbi-enterprise-cli/blob/main/SECURITY.md
|
|
14
|
+
Keywords: power-bi,cli,dax,tmdl,pbir,powerbi,pbip,xmla,fabric
|
|
15
|
+
Classifier: Development Status :: 4 - Beta
|
|
16
|
+
Classifier: Environment :: Console
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: Intended Audience :: Information Technology
|
|
19
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
20
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
21
|
+
Classifier: Operating System :: OS Independent
|
|
22
|
+
Classifier: Programming Language :: Python :: 3
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
27
|
+
Classifier: Topic :: Office/Business
|
|
28
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
29
|
+
Classifier: Topic :: System :: Systems Administration
|
|
30
|
+
Classifier: Typing :: Typed
|
|
31
|
+
Requires-Python: >=3.10
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
License-File: LICENSE
|
|
34
|
+
Requires-Dist: click>=8.1
|
|
35
|
+
Requires-Dist: rich>=13.0
|
|
36
|
+
Requires-Dist: pythonnet==3.1.0rc0
|
|
37
|
+
Requires-Dist: pydantic>=2.0
|
|
38
|
+
Requires-Dist: python-dotenv>=1.0
|
|
39
|
+
Provides-Extra: ai
|
|
40
|
+
Requires-Dist: anthropic>=0.105.2; extra == "ai"
|
|
41
|
+
Provides-Extra: viz
|
|
42
|
+
Requires-Dist: Pillow>=10.0; extra == "viz"
|
|
43
|
+
Requires-Dist: wcag-contrast-ratio>=0.9; extra == "viz"
|
|
44
|
+
Requires-Dist: playwright>=1.44; extra == "viz"
|
|
45
|
+
Provides-Extra: xmla
|
|
46
|
+
Requires-Dist: msal>=1.28; extra == "xmla"
|
|
47
|
+
Provides-Extra: server
|
|
48
|
+
Requires-Dist: fastapi>=0.136.3; extra == "server"
|
|
49
|
+
Requires-Dist: uvicorn>=0.48.0; extra == "server"
|
|
50
|
+
Provides-Extra: sources
|
|
51
|
+
Requires-Dist: sqlalchemy>=2.0; extra == "sources"
|
|
52
|
+
Requires-Dist: openpyxl>=3.1.5; extra == "sources"
|
|
53
|
+
Requires-Dist: httpx>=0.27; extra == "sources"
|
|
54
|
+
Provides-Extra: dev
|
|
55
|
+
Requires-Dist: pytest>=9.0.3; extra == "dev"
|
|
56
|
+
Requires-Dist: pytest-cov>=7.1.0; extra == "dev"
|
|
57
|
+
Requires-Dist: ruff>=0.15.15; extra == "dev"
|
|
58
|
+
Requires-Dist: mypy>=2.1.0; extra == "dev"
|
|
59
|
+
Requires-Dist: pyyaml>=6.0; extra == "dev"
|
|
60
|
+
Provides-Extra: all
|
|
61
|
+
Requires-Dist: pbi-enterprise-cli[ai,dev,server,sources,viz,xmla]; extra == "all"
|
|
62
|
+
Dynamic: license-file
|
|
63
|
+
|
|
64
|
+
# pbi-enterprise-cli
|
|
65
|
+
|
|
66
|
+
**Enterprise-grade Power BI automation CLI — XMLA/Fabric connectivity without Desktop, Python-native BPA governance, and AI-powered measures.**
|
|
67
|
+
|
|
68
|
+
[](https://pypi.org/project/pbi-enterprise-cli/)
|
|
69
|
+
[](https://pypi.org/project/pbi-enterprise-cli/)
|
|
70
|
+
[](https://github.com/mudassir09/pbi-enterprise-cli/blob/main/LICENSE)
|
|
71
|
+
[](https://pypi.org/project/pbi-enterprise-cli/)
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
uv tool install pbi-enterprise-cli
|
|
75
|
+
pbi doctor # verify setup
|
|
76
|
+
pbi model tables # list tables in the connected model
|
|
77
|
+
pbi govern check # run governance rules (exit 3 on violations)
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Key differentiators
|
|
81
|
+
|
|
82
|
+
- **XMLA/Fabric backend** — connect to Power BI Premium or Microsoft Fabric without Desktop
|
|
83
|
+
- **Python-native BPA runner** — the only Python implementation of Best Practice Analyzer rules
|
|
84
|
+
- **Three backends** — Desktop (TOM via pythonnet), XMLA (Premium/Fabric), Mock (CI/CD with zero infrastructure)
|
|
85
|
+
- **AMO DLLs bundled** — works after `pip install` without a separate Desktop installation
|
|
86
|
+
- **Governance engine** — built-in rules + BPA + custom plugin system, `--fail-on` CI gate
|
|
87
|
+
- **10 Claude Code skills** — install with `pbi skills install --all`
|
|
88
|
+
- **CI-ready mock backend** — 500+ unit tests run without real Power BI infrastructure
|
|
89
|
+
|
|
90
|
+
## Install options
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Recommended
|
|
94
|
+
uv tool install pbi-enterprise-cli
|
|
95
|
+
uv tool install "pbi-enterprise-cli[all]" # everything
|
|
96
|
+
|
|
97
|
+
# Alternative
|
|
98
|
+
pipx install pbi-enterprise-cli
|
|
99
|
+
|
|
100
|
+
# Fallback
|
|
101
|
+
pip install pbi-enterprise-cli
|
|
102
|
+
|
|
103
|
+
# With specific extras
|
|
104
|
+
uv tool install "pbi-enterprise-cli[ai,xmla]" # Claude AI + XMLA/Fabric
|
|
105
|
+
uv tool install "pbi-enterprise-cli[sources]" # SQL/Excel/REST profiling
|
|
106
|
+
uv tool install "pbi-enterprise-cli[server]" # FastAPI REST server
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Requirements
|
|
110
|
+
|
|
111
|
+
- Python 3.10+
|
|
112
|
+
- Windows (for Desktop/XMLA backends using .NET AMO)
|
|
113
|
+
- Power BI Desktop (for the `desktop` backend)
|
|
114
|
+
|
|
115
|
+
## Links
|
|
116
|
+
|
|
117
|
+
- [GitHub Repository](https://github.com/mudassir09/pbi-enterprise-cli)
|
|
118
|
+
- [Full Documentation](https://github.com/mudassir09/pbi-enterprise-cli#readme)
|
|
119
|
+
- [XMLA Auth Guide](https://github.com/mudassir09/pbi-enterprise-cli/blob/main/docs/auth/xmla-auth.md)
|
|
120
|
+
- [Deployment Guide](https://github.com/mudassir09/pbi-enterprise-cli/blob/main/docs/deployment.md)
|
|
121
|
+
- [Stability Policy](https://github.com/mudassir09/pbi-enterprise-cli/blob/main/STABILITY.md)
|
|
122
|
+
- [Changelog](https://github.com/mudassir09/pbi-enterprise-cli/blob/main/CHANGELOG.md)
|
|
123
|
+
- [Security Policy](https://github.com/mudassir09/pbi-enterprise-cli/blob/main/SECURITY.md)
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="docs/assets/banner.svg" alt="pbi-enterprise-cli" width="100%"/>
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
<div align="center">
|
|
6
|
+
|
|
7
|
+
[](https://github.com/mudassir09/pbi-enterprise-cli/actions/workflows/ci.yml)
|
|
8
|
+
[](https://codecov.io/gh/mudassir09/pbi-enterprise-cli)
|
|
9
|
+
[](https://pypi.org/project/pbi-enterprise-cli/)
|
|
10
|
+
[](https://pypi.org/project/pbi-enterprise-cli/)
|
|
11
|
+
[](https://github.com/mudassir09/pbi-enterprise-cli/blob/main/LICENSE)
|
|
12
|
+
[](https://pypi.org/project/pbi-enterprise-cli/)
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
**pbi-enterprise-cli** is the enterprise-grade Power BI automation CLI — XMLA/Fabric connectivity without Desktop, the only Python-native BPA governance runner, semantic model management, DAX testing, PBIR authoring, and 10 Claude Code skills.
|
|
19
|
+
|
|
20
|
+
**Key differentiators vs alternatives:**
|
|
21
|
+
|
|
22
|
+
- **XMLA / Fabric without Desktop** — connect directly to Premium or Fabric workspaces via service principal or managed identity; no GUI required
|
|
23
|
+
- **Python-native BPA runner** — the only Python implementation of Best Practice Analyzer; runs on `ubuntu-latest` in CI with zero extra tooling
|
|
24
|
+
- **Three backends, one API** — `desktop` (TOM), `xmla` (Premium/Fabric), `mock` (CI) — same commands, same output, swap with `--backend`
|
|
25
|
+
- **AMO DLLs bundled** — works after `pip install`; no separate Desktop installation needed for XMLA
|
|
26
|
+
- **CI/CD first** — governance gate, DAX unit tests, and snapshot/rollback all work in GitHub Actions on `ubuntu-latest`
|
|
27
|
+
- **10 Claude Code skills** — install with `pbi connect` for AI-assisted Power BI development in under 60 seconds
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
**Recommended — [uv](https://docs.astral.sh/uv/) (fastest, manages Python automatically, no PATH issues on Windows):**
|
|
34
|
+
```bash
|
|
35
|
+
uv tool install pbi-enterprise-cli
|
|
36
|
+
uv tool install "pbi-enterprise-cli[all]" # all optional features
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Alternative — [pipx](https://pipx.pypa.io/):**
|
|
40
|
+
```bash
|
|
41
|
+
pipx install pbi-enterprise-cli
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Fallback — pip:**
|
|
45
|
+
```bash
|
|
46
|
+
pip install pbi-enterprise-cli
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**With specific extras:**
|
|
50
|
+
```bash
|
|
51
|
+
uv tool install "pbi-enterprise-cli[ai,xmla]" # Claude AI + XMLA/Fabric
|
|
52
|
+
uv tool install "pbi-enterprise-cli[sources]" # SQL / Excel / REST profiling
|
|
53
|
+
uv tool install "pbi-enterprise-cli[server]" # FastAPI REST server
|
|
54
|
+
uv tool install "pbi-enterprise-cli[viz]" # WCAG theme validation
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
> **Requirements:** Python 3.10–3.13. The `desktop` and `xmla` backends require Windows. The `mock` backend works on Linux and macOS — CI pipelines need no Windows runner for governance, BPA, and DAX tests.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 60-Second Quickstart
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# 1. Verify setup
|
|
65
|
+
pbi doctor
|
|
66
|
+
|
|
67
|
+
# 2. Connect to open Power BI Desktop + install all 10 Claude Code skills
|
|
68
|
+
pbi connect
|
|
69
|
+
|
|
70
|
+
# 3. Explore the model
|
|
71
|
+
pbi model tables
|
|
72
|
+
pbi measure list
|
|
73
|
+
|
|
74
|
+
# 4. Run governance and BPA
|
|
75
|
+
pbi govern check --fail-on error
|
|
76
|
+
pbi govern bpa check --severity error
|
|
77
|
+
|
|
78
|
+
# 5. Fix safe violations automatically
|
|
79
|
+
pbi govern fix --auto
|
|
80
|
+
|
|
81
|
+
# 6. Run DAX unit tests
|
|
82
|
+
pbi dax test --suite ./tests/measures/
|
|
83
|
+
|
|
84
|
+
# 7. Deploy to Fabric (XMLA)
|
|
85
|
+
pbi deploy push --connection fabric-prod
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Before vs After
|
|
91
|
+
|
|
92
|
+
<div align="center">
|
|
93
|
+
<img src="docs/assets/before-after.svg" alt="Before and after pbi-enterprise-cli" width="100%"/>
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Command Reference
|
|
99
|
+
|
|
100
|
+
| Area | Commands |
|
|
101
|
+
|---|---|
|
|
102
|
+
| **Semantic model** | `pbi model` — tables, columns, relationships, lint, lineage |
|
|
103
|
+
| **DAX measures** | `pbi measure` — add, update, delete, AI-generate, audit |
|
|
104
|
+
| **DAX testing** | `pbi dax` — query, validate, YAML unit-test suites |
|
|
105
|
+
| **Source profiling** | `pbi source` — SQL, Excel, CSV, REST → star-schema scaffold |
|
|
106
|
+
| **Calendar** | `pbi calendar` — generate date tables, fiscal year, mark-as-date-table |
|
|
107
|
+
| **Report authoring** | `pbi report` — pages, bookmarks, drillthrough (PBIR GA format) |
|
|
108
|
+
| **Visuals** | `pbi visual` — 32 visual types, conditional formatting, data bars |
|
|
109
|
+
| **Layout** | `pbi layout` — shelf-packing auto-layout, named templates |
|
|
110
|
+
| **Themes** | `pbi theme` — generate WCAG-compliant themes from a brand colour |
|
|
111
|
+
| **Filters** | `pbi filter` — relative-date, TopN, basic value filters |
|
|
112
|
+
| **Governance** | `pbi govern` — built-in rules + BPA + custom plugins, `--fail-on` CI gate |
|
|
113
|
+
| **Security (RLS)** | `pbi security` — role add/delete/test, perspectives |
|
|
114
|
+
| **Partitions** | `pbi partition` — add, refresh, delete, incremental refresh |
|
|
115
|
+
| **Deployment** | `pbi deploy` — snapshot, diff, push via XMLA |
|
|
116
|
+
| **Snapshots** | `pbi snapshot` — create, list, restore, diff — model rollback |
|
|
117
|
+
| **Environments** | `pbi env` — named connections, use, diff, promote (dev → prod) |
|
|
118
|
+
| **TMDL** | `pbi database` — export / import TMDL snapshots |
|
|
119
|
+
| **Docs** | `pbi docs` — markdown/Confluence data dictionary, lineage, audit log |
|
|
120
|
+
| **Diagnostics** | `pbi doctor` — check pythonnet, optional deps, platform |
|
|
121
|
+
| **Watch mode** | `pbi watch` — re-run governance + DAX tests on file change |
|
|
122
|
+
| **REST API** | `pbi server` — authenticated FastAPI server for pipeline integration |
|
|
123
|
+
| **Skills** | `pbi skills` — install, list, check 10 Claude Code Power BI skills |
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Three-Backend Architecture
|
|
128
|
+
|
|
129
|
+
<div align="center">
|
|
130
|
+
<img src="docs/assets/architecture.svg" alt="Three-backend architecture" width="100%"/>
|
|
131
|
+
</div>
|
|
132
|
+
|
|
133
|
+
| Backend | When to use | Requires |
|
|
134
|
+
|---|---|---|
|
|
135
|
+
| `desktop` (default) | Local Power BI Desktop with a `.pbip` project open | Windows + Desktop |
|
|
136
|
+
| `xmla` | Power BI Premium or Microsoft Fabric — no Desktop | Windows + MSAL (`[xmla]` extra) |
|
|
137
|
+
| `mock` | CI pipelines, unit tests, demos | Nothing — works on Linux/macOS |
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Swap with --backend
|
|
141
|
+
pbi --backend mock govern check --fail-on error # CI on ubuntu-latest
|
|
142
|
+
pbi --backend xmla model tables # Fabric without Desktop
|
|
143
|
+
pbi --backend desktop measure list # local Desktop (default)
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## The Only Python-Native BPA Runner
|
|
149
|
+
|
|
150
|
+
`pbi-enterprise-cli` is the only Python-native implementation of the [Best Practice Analyzer](https://docs.tabulareditor.com/BPA/Best-Practice-Analyzer.html) — run the same rule engine used by Tabular Editor without installing .NET 6 or Tabular Editor itself.
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Microsoft community BPA rules (fetched live — same ruleset as Tabular Editor)
|
|
154
|
+
pbi govern bpa check
|
|
155
|
+
|
|
156
|
+
# Filter to errors only — safe CI gate
|
|
157
|
+
pbi govern bpa check --severity error
|
|
158
|
+
|
|
159
|
+
# Local corporate rule file
|
|
160
|
+
pbi govern bpa check --file ./governance/CorpBPARules.json
|
|
161
|
+
|
|
162
|
+
# JSON output for downstream tooling
|
|
163
|
+
pbi --json govern bpa check --severity error
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**GitHub Actions governance gate — works on `ubuntu-latest`, no Windows runner needed:**
|
|
167
|
+
|
|
168
|
+
```yaml
|
|
169
|
+
- name: BPA governance gate
|
|
170
|
+
run: pbi --backend mock govern bpa check --severity error
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**Custom governance plugin** — drop a `.py` file in `~/.pbi-cli/rules/`:
|
|
174
|
+
|
|
175
|
+
```python
|
|
176
|
+
from pbi_cli.governance.engine import GovernanceRule, Violation
|
|
177
|
+
|
|
178
|
+
class NoHardcodedDatesRule(GovernanceRule):
|
|
179
|
+
id = "custom.no-hardcoded-dates"
|
|
180
|
+
severity = "error"
|
|
181
|
+
|
|
182
|
+
def check(self, model) -> list[Violation]:
|
|
183
|
+
return [
|
|
184
|
+
Violation(self, f"Measure '{m.name}' contains a hardcoded year")
|
|
185
|
+
for m in model.measures
|
|
186
|
+
if "2024" in m.expression or "2025" in m.expression
|
|
187
|
+
]
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Claude Code Skills
|
|
193
|
+
|
|
194
|
+
Run `pbi connect` to install all 10 skills into `~/.claude/skills/` in one step:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
pbi connect # connects to Desktop + installs skills + prints model summary
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Or install manually:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
pbi skills install --all
|
|
204
|
+
pbi skills check # verify compatibility with installed CLI version
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
| Skill | Covers |
|
|
208
|
+
|---|---|
|
|
209
|
+
| `power-bi-modeling` | Star schema, source profiling, partitions, incremental refresh, calendar, M queries |
|
|
210
|
+
| `power-bi-dax` | DAX authoring, Time Intelligence, YAML unit tests, filter context, design patterns |
|
|
211
|
+
| `power-bi-performance` | Query tracing, benchmarking, VertiPaq, storage vs formula engine |
|
|
212
|
+
| `power-bi-report-design` | Pages, 32 visual types, bookmarks, drillthrough, auto-layout, conditional formatting |
|
|
213
|
+
| `power-bi-design-system` | WCAG themes, brand colours, typography, custom visual SDK |
|
|
214
|
+
| `power-bi-governance` | Built-in rules, BPA, custom plugins, auto-fix, CI gate |
|
|
215
|
+
| `power-bi-security-and-docs` | RLS, perspectives, role testing, data dictionary, lineage, audit logs |
|
|
216
|
+
| `power-bi-deployment` | XMLA deploy, TMDL snapshots, multi-environment promotion, auth setup |
|
|
217
|
+
| `power-bi-diagnostics` | `pbi doctor`, pythonnet/AMO resolution, error playbook, connection troubleshooting |
|
|
218
|
+
| `power-bi-project-orchestrator` | Coordinates multi-skill workflows: model → DAX → governance → report → deploy |
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## CI/CD Integration
|
|
223
|
+
|
|
224
|
+
Full governance + BPA + DAX tests run on `ubuntu-latest` with the mock backend — no Windows runner, no Power BI infrastructure.
|
|
225
|
+
|
|
226
|
+
```yaml
|
|
227
|
+
# .github/workflows/pbi-govern.yml
|
|
228
|
+
name: Power BI Governance
|
|
229
|
+
|
|
230
|
+
on: [push, pull_request]
|
|
231
|
+
|
|
232
|
+
jobs:
|
|
233
|
+
govern:
|
|
234
|
+
runs-on: ubuntu-latest
|
|
235
|
+
steps:
|
|
236
|
+
- uses: actions/checkout@v4
|
|
237
|
+
- run: pip install pbi-enterprise-cli
|
|
238
|
+
|
|
239
|
+
- name: Governance rules
|
|
240
|
+
run: pbi --backend mock govern check --fail-on error
|
|
241
|
+
|
|
242
|
+
- name: BPA check
|
|
243
|
+
run: pbi --backend mock govern bpa check --severity error
|
|
244
|
+
|
|
245
|
+
- name: DAX unit tests
|
|
246
|
+
run: pbi --backend mock dax test --suite ./tests/measures/
|
|
247
|
+
|
|
248
|
+
- name: Upload governance report
|
|
249
|
+
if: always()
|
|
250
|
+
run: pbi --backend mock --json govern check > governance-report.json
|
|
251
|
+
- uses: actions/upload-artifact@v4
|
|
252
|
+
if: always()
|
|
253
|
+
with:
|
|
254
|
+
name: governance-report
|
|
255
|
+
path: governance-report.json
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Global Flags
|
|
261
|
+
|
|
262
|
+
| Flag | Purpose |
|
|
263
|
+
|---|---|
|
|
264
|
+
| `--backend desktop\|xmla\|mock` | Select backend (default: `desktop`) |
|
|
265
|
+
| `--dry-run` | Preview changes without applying them |
|
|
266
|
+
| `--json` | Machine-readable JSON output |
|
|
267
|
+
| `--connection <name>` | Use a named connection from `~/.pbi-cli/connections.json` |
|
|
268
|
+
| `--port 5000` | Desktop local server port |
|
|
269
|
+
|
|
270
|
+
## Exit Code Contract
|
|
271
|
+
|
|
272
|
+
| Code | Meaning |
|
|
273
|
+
|---|---|
|
|
274
|
+
| `0` | Success |
|
|
275
|
+
| `1` | User error — bad args, missing flags |
|
|
276
|
+
| `2` | Connection error — Desktop not open, XMLA unreachable |
|
|
277
|
+
| `3` | Validation error — governance violation, schema error |
|
|
278
|
+
| `4` | Operation error — TOM write failed, partial completion |
|
|
279
|
+
|
|
280
|
+
## Environment Variables
|
|
281
|
+
|
|
282
|
+
| Variable | Purpose |
|
|
283
|
+
|---|---|
|
|
284
|
+
| `ANTHROPIC_API_KEY` | Claude AI for `pbi measure generate` |
|
|
285
|
+
| `PBI_SERVER_KEY` | API key for `pbi server start` |
|
|
286
|
+
| `PBI_CLIENT_SECRET` | Service principal secret for XMLA connections |
|
|
287
|
+
| `PBI_REST_BEARER` | Default Bearer token for REST source profiling |
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## Contributing
|
|
292
|
+
|
|
293
|
+
Contributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for setup instructions, branch strategy, and the PR process.
|
|
294
|
+
|
|
295
|
+
**Good First Issues** are labelled [`good first issue`](https://github.com/mudassir09/pbi-enterprise-cli/issues?q=label%3A%22good+first+issue%22) — these are self-contained tasks with clear acceptance criteria and no deep context required.
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## Documentation
|
|
300
|
+
|
|
301
|
+
| Document | Contents |
|
|
302
|
+
|---|---|
|
|
303
|
+
| [docs/auth/xmla-auth.md](docs/auth/xmla-auth.md) | XMLA auth: service principal, managed identity, device flow |
|
|
304
|
+
| [docs/deployment.md](docs/deployment.md) | Snapshot format, diff algorithm, push safety, rollback |
|
|
305
|
+
| [CHANGELOG.md](CHANGELOG.md) | Release history |
|
|
306
|
+
| [SECURITY.md](SECURITY.md) | Security policy and vulnerability reporting |
|
|
307
|
+
| [CONTRIBUTING.md](CONTRIBUTING.md) | Branch strategy, coding standards, PR guide |
|
|
308
|
+
| [STABILITY.md](STABILITY.md) | Stable command surface, exit code contract, deprecation policy |
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## License
|
|
313
|
+
|
|
314
|
+
MIT © [Mudassir](https://github.com/mudassir09) — see [LICENSE](LICENSE).
|
|
315
|
+
|
|
316
|
+
The bundled AMO/ADOMD client libraries are licensed under the [Microsoft Software License Terms](https://go.microsoft.com/fwlink/?LinkId=2179979).
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# pbi-enterprise-cli
|
|
2
|
+
|
|
3
|
+
**Enterprise-grade Power BI automation CLI — XMLA/Fabric connectivity without Desktop, Python-native BPA governance, and AI-powered measures.**
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/pbi-enterprise-cli/)
|
|
6
|
+
[](https://pypi.org/project/pbi-enterprise-cli/)
|
|
7
|
+
[](https://github.com/mudassir09/pbi-enterprise-cli/blob/main/LICENSE)
|
|
8
|
+
[](https://pypi.org/project/pbi-enterprise-cli/)
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
uv tool install pbi-enterprise-cli
|
|
12
|
+
pbi doctor # verify setup
|
|
13
|
+
pbi model tables # list tables in the connected model
|
|
14
|
+
pbi govern check # run governance rules (exit 3 on violations)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Key differentiators
|
|
18
|
+
|
|
19
|
+
- **XMLA/Fabric backend** — connect to Power BI Premium or Microsoft Fabric without Desktop
|
|
20
|
+
- **Python-native BPA runner** — the only Python implementation of Best Practice Analyzer rules
|
|
21
|
+
- **Three backends** — Desktop (TOM via pythonnet), XMLA (Premium/Fabric), Mock (CI/CD with zero infrastructure)
|
|
22
|
+
- **AMO DLLs bundled** — works after `pip install` without a separate Desktop installation
|
|
23
|
+
- **Governance engine** — built-in rules + BPA + custom plugin system, `--fail-on` CI gate
|
|
24
|
+
- **10 Claude Code skills** — install with `pbi skills install --all`
|
|
25
|
+
- **CI-ready mock backend** — 500+ unit tests run without real Power BI infrastructure
|
|
26
|
+
|
|
27
|
+
## Install options
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Recommended
|
|
31
|
+
uv tool install pbi-enterprise-cli
|
|
32
|
+
uv tool install "pbi-enterprise-cli[all]" # everything
|
|
33
|
+
|
|
34
|
+
# Alternative
|
|
35
|
+
pipx install pbi-enterprise-cli
|
|
36
|
+
|
|
37
|
+
# Fallback
|
|
38
|
+
pip install pbi-enterprise-cli
|
|
39
|
+
|
|
40
|
+
# With specific extras
|
|
41
|
+
uv tool install "pbi-enterprise-cli[ai,xmla]" # Claude AI + XMLA/Fabric
|
|
42
|
+
uv tool install "pbi-enterprise-cli[sources]" # SQL/Excel/REST profiling
|
|
43
|
+
uv tool install "pbi-enterprise-cli[server]" # FastAPI REST server
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Requirements
|
|
47
|
+
|
|
48
|
+
- Python 3.10+
|
|
49
|
+
- Windows (for Desktop/XMLA backends using .NET AMO)
|
|
50
|
+
- Power BI Desktop (for the `desktop` backend)
|
|
51
|
+
|
|
52
|
+
## Links
|
|
53
|
+
|
|
54
|
+
- [GitHub Repository](https://github.com/mudassir09/pbi-enterprise-cli)
|
|
55
|
+
- [Full Documentation](https://github.com/mudassir09/pbi-enterprise-cli#readme)
|
|
56
|
+
- [XMLA Auth Guide](https://github.com/mudassir09/pbi-enterprise-cli/blob/main/docs/auth/xmla-auth.md)
|
|
57
|
+
- [Deployment Guide](https://github.com/mudassir09/pbi-enterprise-cli/blob/main/docs/deployment.md)
|
|
58
|
+
- [Stability Policy](https://github.com/mudassir09/pbi-enterprise-cli/blob/main/STABILITY.md)
|
|
59
|
+
- [Changelog](https://github.com/mudassir09/pbi-enterprise-cli/blob/main/CHANGELOG.md)
|
|
60
|
+
- [Security Policy](https://github.com/mudassir09/pbi-enterprise-cli/blob/main/SECURITY.md)
|
|
@@ -1,55 +1,63 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools>=
|
|
2
|
+
requires = ["setuptools>=82.0.1", "wheel"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pbi-enterprise-cli"
|
|
7
|
-
version = "
|
|
8
|
-
description = "Power BI
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Full-stack Power BI automation CLI — XMLA/Fabric connectivity, Python-native BPA governance, semantic model management, DAX testing, PBIR authoring, and AI-powered measures"
|
|
9
9
|
readme = "README.pypi.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
11
11
|
license = { text = "MIT AND LicenseRef-Microsoft-AS-Client-Libraries" }
|
|
12
|
-
keywords = ["power-bi", "cli", "dax", "tmdl", "pbir", "powerbi", "
|
|
12
|
+
keywords = ["power-bi", "cli", "dax", "tmdl", "pbir", "powerbi", "pbip", "xmla", "fabric"]
|
|
13
13
|
authors = [
|
|
14
|
-
{ name = "Mudassir", email = "mir.mudassir1@gmail.com" }
|
|
14
|
+
{ name = "Mudassir", email = "mir.mudassir1@gmail.com" }
|
|
15
|
+
]
|
|
16
|
+
maintainers = [
|
|
17
|
+
{ name = "Mudassir", email = "mir.mudassir1@gmail.com" }
|
|
15
18
|
]
|
|
16
19
|
classifiers = [
|
|
17
|
-
"Development Status ::
|
|
20
|
+
"Development Status :: 4 - Beta",
|
|
18
21
|
"Environment :: Console",
|
|
19
22
|
"Intended Audience :: Developers",
|
|
20
23
|
"Intended Audience :: Information Technology",
|
|
21
24
|
"License :: OSI Approved :: MIT License",
|
|
25
|
+
"Operating System :: Microsoft :: Windows",
|
|
22
26
|
"Operating System :: OS Independent",
|
|
23
27
|
"Programming Language :: Python :: 3",
|
|
24
28
|
"Programming Language :: Python :: 3.10",
|
|
25
29
|
"Programming Language :: Python :: 3.11",
|
|
26
30
|
"Programming Language :: Python :: 3.12",
|
|
27
|
-
"
|
|
31
|
+
"Programming Language :: Python :: 3.13",
|
|
28
32
|
"Topic :: Office/Business",
|
|
33
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
34
|
+
"Topic :: System :: Systems Administration",
|
|
35
|
+
"Typing :: Typed",
|
|
29
36
|
]
|
|
30
37
|
dependencies = [
|
|
31
38
|
"click>=8.1",
|
|
32
39
|
"rich>=13.0",
|
|
33
|
-
"pythonnet
|
|
40
|
+
"pythonnet==3.1.0rc0",
|
|
34
41
|
"pydantic>=2.0",
|
|
35
42
|
"python-dotenv>=1.0",
|
|
36
|
-
"PyYAML>=6.0",
|
|
37
43
|
]
|
|
38
44
|
|
|
39
45
|
[project.urls]
|
|
40
46
|
Homepage = "https://github.com/mudassir09/pbi-enterprise-cli"
|
|
41
47
|
Repository = "https://github.com/mudassir09/pbi-enterprise-cli"
|
|
42
|
-
|
|
48
|
+
Documentation = "https://github.com/mudassir09/pbi-enterprise-cli#readme"
|
|
43
49
|
Changelog = "https://github.com/mudassir09/pbi-enterprise-cli/blob/main/CHANGELOG.md"
|
|
50
|
+
"Bug Tracker" = "https://github.com/mudassir09/pbi-enterprise-cli/issues"
|
|
51
|
+
"Security Policy" = "https://github.com/mudassir09/pbi-enterprise-cli/blob/main/SECURITY.md"
|
|
44
52
|
|
|
45
53
|
[project.optional-dependencies]
|
|
46
|
-
ai
|
|
47
|
-
viz
|
|
48
|
-
xmla
|
|
49
|
-
server = ["fastapi>=0.
|
|
50
|
-
sources = ["sqlalchemy>=2.0", "openpyxl>=3.1", "httpx>=0.27"]
|
|
51
|
-
dev
|
|
52
|
-
all
|
|
54
|
+
ai = ["anthropic>=0.105.2"]
|
|
55
|
+
viz = ["Pillow>=10.0", "wcag-contrast-ratio>=0.9", "playwright>=1.44"]
|
|
56
|
+
xmla = ["msal>=1.28"]
|
|
57
|
+
server = ["fastapi>=0.136.3", "uvicorn>=0.48.0"]
|
|
58
|
+
sources = ["sqlalchemy>=2.0", "openpyxl>=3.1.5", "httpx>=0.27"]
|
|
59
|
+
dev = ["pytest>=9.0.3", "pytest-cov>=7.1.0", "ruff>=0.15.15", "mypy>=2.1.0", "pyyaml>=6.0"]
|
|
60
|
+
all = ["pbi-enterprise-cli[ai,viz,xmla,server,sources,dev]"]
|
|
53
61
|
|
|
54
62
|
[project.scripts]
|
|
55
63
|
pbi = "pbi_cli.cli:cli"
|
|
@@ -57,9 +65,6 @@ pbi = "pbi_cli.cli:cli"
|
|
|
57
65
|
[tool.setuptools.packages.find]
|
|
58
66
|
where = ["src"]
|
|
59
67
|
|
|
60
|
-
[tool.setuptools.package-data]
|
|
61
|
-
pbi_cli = ["dlls/*.dll"]
|
|
62
|
-
|
|
63
68
|
[tool.ruff]
|
|
64
69
|
line-length = 100
|
|
65
70
|
target-version = "py310"
|
|
@@ -73,12 +78,25 @@ ignore_missing_imports = true
|
|
|
73
78
|
warn_unused_ignores = false
|
|
74
79
|
# strict mode is disabled: backends use pythonnet/AMO dynamic dispatch (Any is intentional)
|
|
75
80
|
|
|
81
|
+
[tool.pytest.ini_options]
|
|
82
|
+
testpaths = ["tests"]
|
|
83
|
+
addopts = "--cov=pbi_cli --cov-report=term-missing --cov-fail-under=67"
|
|
84
|
+
markers = ["e2e: requires live Power BI Desktop or XMLA endpoint"]
|
|
85
|
+
|
|
76
86
|
[tool.coverage.run]
|
|
77
87
|
omit = [
|
|
88
|
+
# TOM/XMLA backends require Windows .NET (pythonnet/AMO) — untestable on Linux CI
|
|
78
89
|
"src/pbi_cli/backends/tom_backend.py",
|
|
79
|
-
"src/pbi_cli/
|
|
90
|
+
"src/pbi_cli/backends/xmla_backend.py",
|
|
80
91
|
]
|
|
81
92
|
|
|
82
|
-
[tool.
|
|
83
|
-
|
|
84
|
-
|
|
93
|
+
[tool.coverage.report]
|
|
94
|
+
exclude_lines = [
|
|
95
|
+
"pragma: no cover",
|
|
96
|
+
"if TYPE_CHECKING",
|
|
97
|
+
"raise NotImplementedError",
|
|
98
|
+
]
|
|
99
|
+
omit = [
|
|
100
|
+
"src/pbi_cli/backends/tom_backend.py",
|
|
101
|
+
"src/pbi_cli/backends/xmla_backend.py",
|
|
102
|
+
]
|
{pbi_enterprise_cli-0.1.0.dev2 → pbi_enterprise_cli-1.0.0}/src/pbi_cli/backends/xmla_backend.py
RENAMED
|
@@ -25,7 +25,7 @@ Example::
|
|
|
25
25
|
Requires ``pythonnet`` (in core deps) plus ``msal`` for token-based auth.
|
|
26
26
|
Install the optional extra for the full stack::
|
|
27
27
|
|
|
28
|
-
pip install pbi-
|
|
28
|
+
pip install pbi-cli-tool[xmla]
|
|
29
29
|
|
|
30
30
|
The .NET AMO/ADOMD assemblies ship with Power BI Desktop (Windows) or can be
|
|
31
31
|
installed via the NuGet packages ``Microsoft.AnalysisServices.retail.amd64`` and
|
|
@@ -114,7 +114,7 @@ class XmlaAuth:
|
|
|
114
114
|
except ImportError:
|
|
115
115
|
raise ImportError(
|
|
116
116
|
"msal is required for device_flow / service_principal auth.\n"
|
|
117
|
-
"Install with: pip install pbi-
|
|
117
|
+
"Install with: pip install pbi-cli-tool[xmla]"
|
|
118
118
|
) from None
|
|
119
119
|
|
|
120
120
|
authority = f"https://login.microsoftonline.com/{self.tenant_id or 'common'}"
|
|
@@ -169,7 +169,7 @@ def _load_amo(): # type: ignore[return]
|
|
|
169
169
|
except Exception as exc:
|
|
170
170
|
raise ImportError(
|
|
171
171
|
"The XMLA backend requires pythonnet and the AMO .NET assemblies.\n"
|
|
172
|
-
"Install with: pip install pbi-
|
|
172
|
+
"Install with: pip install pbi-cli-tool[xmla]\n"
|
|
173
173
|
"The AMO assemblies ship with Power BI Desktop (Windows) or can be\n"
|
|
174
174
|
"installed via NuGet: Microsoft.AnalysisServices.retail.amd64"
|
|
175
175
|
) from exc
|
|
@@ -189,8 +189,7 @@ def _load_adomd(): # type: ignore[return]
|
|
|
189
189
|
return AdomdConnection, AdomdCommand
|
|
190
190
|
except Exception as exc:
|
|
191
191
|
raise ImportError(
|
|
192
|
-
"AdomdClient .NET assembly not found.\
|
|
193
|
-
"Install with: pip install pbi-enterprise-cli[xmla]"
|
|
192
|
+
"AdomdClient .NET assembly not found.\nInstall with: pip install pbi-cli-tool[xmla]"
|
|
194
193
|
) from exc
|
|
195
194
|
|
|
196
195
|
|