msdev-kit 0.2.3__tar.gz → 0.2.4__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.
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/PKG-INFO +52 -33
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/README.md +51 -32
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/msdev_kit/__init__.py +1 -1
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/pyproject.toml +1 -1
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/LICENSE +0 -0
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/msdev_kit/auth.py +0 -0
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/msdev_kit/fabric/__init__.py +0 -0
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/msdev_kit/fabric/admin.py +0 -0
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/msdev_kit/fabric/capacity.py +0 -0
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/msdev_kit/fabric/database.py +0 -0
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/msdev_kit/fabric/dataflow.py +0 -0
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/msdev_kit/fabric/dataset.py +0 -0
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/msdev_kit/fabric/kql.py +0 -0
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/msdev_kit/fabric/notebook.py +0 -0
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/msdev_kit/fabric/operations.py +0 -0
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/msdev_kit/fabric/pipeline.py +0 -0
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/msdev_kit/fabric/report.py +0 -0
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/msdev_kit/fabric/utilities.py +0 -0
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/msdev_kit/fabric/workspace.py +0 -0
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/msdev_kit/graph/__init__.py +0 -0
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/msdev_kit/graph/client.py +0 -0
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/msdev_kit/http.py +0 -0
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/msdev_kit/sharepoint/__init__.py +0 -0
- {msdev_kit-0.2.3 → msdev_kit-0.2.4}/msdev_kit/sharepoint/client.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: msdev-kit
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: Microsoft developer toolkit: Fabric, MS Graph, and SharePoint
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -65,15 +65,11 @@ Or install from GitHub:
|
|
|
65
65
|
pip install git+https://github.com/Bernardo-Rufino/msdev-kit.git
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
For local development
|
|
68
|
+
For local development, use the repository instructions in [Development](docs/development.md).
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
pip install -e .
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
**Requirements:** Python >= 3.10, an Azure app registration with a client ID and client secret.
|
|
70
|
+
**Requirements:** Python >= 3.10. Service principal authentication requires an
|
|
71
|
+
Azure app registration, tenant ID, client ID, and client secret. Interactive
|
|
72
|
+
user authentication is also supported for APIs that permit it.
|
|
77
73
|
|
|
78
74
|
---
|
|
79
75
|
|
|
@@ -89,7 +85,7 @@ from msdev_kit.sharepoint import SharePointClient
|
|
|
89
85
|
auth = Auth(tenant_id="...", client_id="...", client_secret="...")
|
|
90
86
|
|
|
91
87
|
# fabric: list workspaces
|
|
92
|
-
ws = Workspace(auth.get_token('
|
|
88
|
+
ws = Workspace(auth.get_token('pbi'))
|
|
93
89
|
workspaces = ws.list_workspaces_for_user()
|
|
94
90
|
|
|
95
91
|
# graph: look up a user
|
|
@@ -105,7 +101,10 @@ sp.download_file('/Reports/monthly.xlsx', local_dir='./downloads')
|
|
|
105
101
|
|
|
106
102
|
## Authentication
|
|
107
103
|
|
|
108
|
-
|
|
104
|
+
`Auth` owns token acquisition. Fabric and Power BI classes receive a token string,
|
|
105
|
+
while Graph and SharePoint clients receive the `Auth` instance. You can use
|
|
106
|
+
different service principals for different services by instantiating one `Auth`
|
|
107
|
+
per service principal:
|
|
109
108
|
|
|
110
109
|
```python
|
|
111
110
|
from msdev_kit import Auth
|
|
@@ -142,14 +141,16 @@ token = auth.get_token_for_user('fabric')
|
|
|
142
141
|
|
|
143
142
|
### Credentials
|
|
144
143
|
|
|
145
|
-
|
|
144
|
+
For the bundled examples, copy the template and set the values:
|
|
146
145
|
|
|
147
146
|
```shell
|
|
148
|
-
|
|
149
|
-
CLIENT_ID='<YOUR_CLIENT_ID>'
|
|
150
|
-
CLIENT_SECRET='<YOUR_CLIENT_SECRET>'
|
|
147
|
+
cp .env.example .env
|
|
151
148
|
```
|
|
152
149
|
|
|
150
|
+
`msdev-kit` does not load `.env` automatically. The scripts in `examples/` load
|
|
151
|
+
`.env` from the repository root. Applications may pass values directly to
|
|
152
|
+
`Auth`, or load environment variables with their own configuration mechanism.
|
|
153
|
+
|
|
153
154
|
---
|
|
154
155
|
|
|
155
156
|
## Fabric & Power BI
|
|
@@ -239,7 +240,7 @@ pages = rpt.list_report_pages(workspace_id, report_id)
|
|
|
239
240
|
Manage Power BI and Fabric dataflows, including Gen1, Gen2, and Gen2 CI/CD.
|
|
240
241
|
|
|
241
242
|
```python
|
|
242
|
-
df = Dataflow(auth.get_token('
|
|
243
|
+
df = Dataflow(auth.get_token('pbi'))
|
|
243
244
|
|
|
244
245
|
# upgrade Gen1 to Gen2 CI/CD
|
|
245
246
|
result = df.upgrade_to_gen2_cicd(
|
|
@@ -262,11 +263,33 @@ result = df.upgrade_to_gen2_cicd(
|
|
|
262
263
|
| `create_dataflow_gen2_from_definition(workspace_id, display_name, definition)` | Create a Dataflow Gen2 CI/CD from a definition. |
|
|
263
264
|
| `update_dataflow_gen2_from_definition(workspace_id, dataflow_id, display_name, definition)` | Update an existing Dataflow Gen2 CI/CD definition. |
|
|
264
265
|
| `get_data_destinations(workspace_id, dataflow_id)` | Get data destination details for each table in a dataflow. |
|
|
265
|
-
| `get_workspace_data_destinations(workspace_id, max_workers=4)` |
|
|
266
|
+
| `get_workspace_data_destinations(workspace_id, max_workers=4)` | Inspect every dataflow, return its destination details, and save destination-only rows as a workbook under `data/dataflows`. The inventory is paced at 200 requests per minute and retries 429 responses. |
|
|
266
267
|
| `change_data_destination(workspace_id, dataflow_id, destination_type, ...)` | Change data destination (Lakehouse/Warehouse). Modes: `preview`, `replace`, `create`. |
|
|
267
268
|
| `create_dataflow_with_new_destination(workspace_id, dataflow_id, ...)` | Create a new Gen2 CI/CD dataflow with a different data destination. |
|
|
268
269
|
| `upgrade_to_gen2_cicd(...)` | Upgrade a Gen1 or Gen2 (standard) dataflow to Gen2 CI/CD. |
|
|
269
270
|
|
|
271
|
+
#### Inventory workspace data destinations
|
|
272
|
+
|
|
273
|
+
```python
|
|
274
|
+
from msdev_kit import Auth
|
|
275
|
+
from msdev_kit.fabric import Dataflow
|
|
276
|
+
|
|
277
|
+
workspace_id = "<workspace-id>"
|
|
278
|
+
auth = Auth(tenant_id="<tenant-id>", client_id="<client-id>", client_secret="<client-secret>")
|
|
279
|
+
dataflow = Dataflow(auth.get_token("pbi"))
|
|
280
|
+
|
|
281
|
+
result = dataflow.get_workspace_data_destinations(workspace_id, max_workers=4)
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
The method inspects every dataflow so `result["content"]` also records empty
|
|
285
|
+
inspections and failures. Its workbook contains only table rows with a real data
|
|
286
|
+
destination. Table name is exported as `table_name`, not `table_table`. A Fabric
|
|
287
|
+
source without an API generation value is normalized to `2.1`. The progress line
|
|
288
|
+
is updated in place. If a 429 response occurs, the method prints the completed
|
|
289
|
+
count, waits, then resumes the progress line. See
|
|
290
|
+
[`examples/dataflow_destinations.py`](examples/dataflow_destinations.py) for a
|
|
291
|
+
DataFrame normalizer and a runnable placeholder.
|
|
292
|
+
|
|
270
293
|
### Pipeline
|
|
271
294
|
|
|
272
295
|
Manage Fabric Data Pipelines.
|
|
@@ -411,7 +434,7 @@ Hostname and site path inputs are normalized automatically:
|
|
|
411
434
|
|
|
412
435
|
## Limitations
|
|
413
436
|
|
|
414
|
-
-
|
|
437
|
+
- Power BI and Fabric endpoints apply operation-specific throttling. Do not assume one global quota. `get_workspace_data_destinations` intentionally paces definition lookups at 200 requests per minute and backs off after HTTP 429.
|
|
415
438
|
- Not all users can be updated via the API. See Microsoft docs: [Dataset permissions](https://learn.microsoft.com/en-us/power-bi/developer/embedded/datasets-permissions#get-and-update-dataset-permissions-with-apis).
|
|
416
439
|
- **Dataset query limits** (executeQueries API):
|
|
417
440
|
- Max **100,000 rows** or **1,000,000 values** (rows x columns) per query, whichever is hit first.
|
|
@@ -425,28 +448,24 @@ Hostname and site path inputs are normalized automatically:
|
|
|
425
448
|
|
|
426
449
|
## Examples
|
|
427
450
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
451
|
+
Runnable, placeholder-based scripts live in [`examples/`](./examples). Start
|
|
452
|
+
with the [examples guide](examples/README.md), then run a read-only example from
|
|
453
|
+
the repository root:
|
|
431
454
|
|
|
432
455
|
```bash
|
|
456
|
+
cp .env.example .env
|
|
433
457
|
python -m examples.workspaces
|
|
434
|
-
python -m examples.
|
|
458
|
+
python -m examples.dataflow_destinations
|
|
435
459
|
```
|
|
436
460
|
|
|
461
|
+
Write examples never perform a mutation when run directly. Edit the placeholder
|
|
462
|
+
values and call their explicit helper only after reviewing the target IDs.
|
|
463
|
+
|
|
437
464
|
---
|
|
438
465
|
|
|
439
466
|
## Contributing
|
|
440
467
|
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
2. Use `feature/<name>` / `fix/<name>` branches. Direct pushes to `main` are
|
|
445
|
-
blocked by repository rulesets.
|
|
446
|
-
3. Keep PRs focused. Add or update tests under `tests/` for any behavior change.
|
|
447
|
-
4. Run `pytest` locally before opening a PR; the `Collaboration` workflow runs
|
|
448
|
-
the same suite on every PR and must pass before merging.
|
|
449
|
-
|
|
450
|
-
PyPI releases are published automatically from `main` by the `Publish to PyPI`
|
|
451
|
-
workflow, gated by a manual approval on the `pypi` environment.
|
|
468
|
+
Read [Contributing](CONTRIBUTING.md) before opening a pull request. It links the
|
|
469
|
+
local setup, validation commands, issue and pull request process, branch
|
|
470
|
+
conventions, and release boundary.
|
|
452
471
|
|
|
@@ -32,15 +32,11 @@ Or install from GitHub:
|
|
|
32
32
|
pip install git+https://github.com/Bernardo-Rufino/msdev-kit.git
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
For local development
|
|
35
|
+
For local development, use the repository instructions in [Development](docs/development.md).
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
pip install -e .
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
**Requirements:** Python >= 3.10, an Azure app registration with a client ID and client secret.
|
|
37
|
+
**Requirements:** Python >= 3.10. Service principal authentication requires an
|
|
38
|
+
Azure app registration, tenant ID, client ID, and client secret. Interactive
|
|
39
|
+
user authentication is also supported for APIs that permit it.
|
|
44
40
|
|
|
45
41
|
---
|
|
46
42
|
|
|
@@ -56,7 +52,7 @@ from msdev_kit.sharepoint import SharePointClient
|
|
|
56
52
|
auth = Auth(tenant_id="...", client_id="...", client_secret="...")
|
|
57
53
|
|
|
58
54
|
# fabric: list workspaces
|
|
59
|
-
ws = Workspace(auth.get_token('
|
|
55
|
+
ws = Workspace(auth.get_token('pbi'))
|
|
60
56
|
workspaces = ws.list_workspaces_for_user()
|
|
61
57
|
|
|
62
58
|
# graph: look up a user
|
|
@@ -72,7 +68,10 @@ sp.download_file('/Reports/monthly.xlsx', local_dir='./downloads')
|
|
|
72
68
|
|
|
73
69
|
## Authentication
|
|
74
70
|
|
|
75
|
-
|
|
71
|
+
`Auth` owns token acquisition. Fabric and Power BI classes receive a token string,
|
|
72
|
+
while Graph and SharePoint clients receive the `Auth` instance. You can use
|
|
73
|
+
different service principals for different services by instantiating one `Auth`
|
|
74
|
+
per service principal:
|
|
76
75
|
|
|
77
76
|
```python
|
|
78
77
|
from msdev_kit import Auth
|
|
@@ -109,14 +108,16 @@ token = auth.get_token_for_user('fabric')
|
|
|
109
108
|
|
|
110
109
|
### Credentials
|
|
111
110
|
|
|
112
|
-
|
|
111
|
+
For the bundled examples, copy the template and set the values:
|
|
113
112
|
|
|
114
113
|
```shell
|
|
115
|
-
|
|
116
|
-
CLIENT_ID='<YOUR_CLIENT_ID>'
|
|
117
|
-
CLIENT_SECRET='<YOUR_CLIENT_SECRET>'
|
|
114
|
+
cp .env.example .env
|
|
118
115
|
```
|
|
119
116
|
|
|
117
|
+
`msdev-kit` does not load `.env` automatically. The scripts in `examples/` load
|
|
118
|
+
`.env` from the repository root. Applications may pass values directly to
|
|
119
|
+
`Auth`, or load environment variables with their own configuration mechanism.
|
|
120
|
+
|
|
120
121
|
---
|
|
121
122
|
|
|
122
123
|
## Fabric & Power BI
|
|
@@ -206,7 +207,7 @@ pages = rpt.list_report_pages(workspace_id, report_id)
|
|
|
206
207
|
Manage Power BI and Fabric dataflows, including Gen1, Gen2, and Gen2 CI/CD.
|
|
207
208
|
|
|
208
209
|
```python
|
|
209
|
-
df = Dataflow(auth.get_token('
|
|
210
|
+
df = Dataflow(auth.get_token('pbi'))
|
|
210
211
|
|
|
211
212
|
# upgrade Gen1 to Gen2 CI/CD
|
|
212
213
|
result = df.upgrade_to_gen2_cicd(
|
|
@@ -229,11 +230,33 @@ result = df.upgrade_to_gen2_cicd(
|
|
|
229
230
|
| `create_dataflow_gen2_from_definition(workspace_id, display_name, definition)` | Create a Dataflow Gen2 CI/CD from a definition. |
|
|
230
231
|
| `update_dataflow_gen2_from_definition(workspace_id, dataflow_id, display_name, definition)` | Update an existing Dataflow Gen2 CI/CD definition. |
|
|
231
232
|
| `get_data_destinations(workspace_id, dataflow_id)` | Get data destination details for each table in a dataflow. |
|
|
232
|
-
| `get_workspace_data_destinations(workspace_id, max_workers=4)` |
|
|
233
|
+
| `get_workspace_data_destinations(workspace_id, max_workers=4)` | Inspect every dataflow, return its destination details, and save destination-only rows as a workbook under `data/dataflows`. The inventory is paced at 200 requests per minute and retries 429 responses. |
|
|
233
234
|
| `change_data_destination(workspace_id, dataflow_id, destination_type, ...)` | Change data destination (Lakehouse/Warehouse). Modes: `preview`, `replace`, `create`. |
|
|
234
235
|
| `create_dataflow_with_new_destination(workspace_id, dataflow_id, ...)` | Create a new Gen2 CI/CD dataflow with a different data destination. |
|
|
235
236
|
| `upgrade_to_gen2_cicd(...)` | Upgrade a Gen1 or Gen2 (standard) dataflow to Gen2 CI/CD. |
|
|
236
237
|
|
|
238
|
+
#### Inventory workspace data destinations
|
|
239
|
+
|
|
240
|
+
```python
|
|
241
|
+
from msdev_kit import Auth
|
|
242
|
+
from msdev_kit.fabric import Dataflow
|
|
243
|
+
|
|
244
|
+
workspace_id = "<workspace-id>"
|
|
245
|
+
auth = Auth(tenant_id="<tenant-id>", client_id="<client-id>", client_secret="<client-secret>")
|
|
246
|
+
dataflow = Dataflow(auth.get_token("pbi"))
|
|
247
|
+
|
|
248
|
+
result = dataflow.get_workspace_data_destinations(workspace_id, max_workers=4)
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
The method inspects every dataflow so `result["content"]` also records empty
|
|
252
|
+
inspections and failures. Its workbook contains only table rows with a real data
|
|
253
|
+
destination. Table name is exported as `table_name`, not `table_table`. A Fabric
|
|
254
|
+
source without an API generation value is normalized to `2.1`. The progress line
|
|
255
|
+
is updated in place. If a 429 response occurs, the method prints the completed
|
|
256
|
+
count, waits, then resumes the progress line. See
|
|
257
|
+
[`examples/dataflow_destinations.py`](examples/dataflow_destinations.py) for a
|
|
258
|
+
DataFrame normalizer and a runnable placeholder.
|
|
259
|
+
|
|
237
260
|
### Pipeline
|
|
238
261
|
|
|
239
262
|
Manage Fabric Data Pipelines.
|
|
@@ -378,7 +401,7 @@ Hostname and site path inputs are normalized automatically:
|
|
|
378
401
|
|
|
379
402
|
## Limitations
|
|
380
403
|
|
|
381
|
-
-
|
|
404
|
+
- Power BI and Fabric endpoints apply operation-specific throttling. Do not assume one global quota. `get_workspace_data_destinations` intentionally paces definition lookups at 200 requests per minute and backs off after HTTP 429.
|
|
382
405
|
- Not all users can be updated via the API. See Microsoft docs: [Dataset permissions](https://learn.microsoft.com/en-us/power-bi/developer/embedded/datasets-permissions#get-and-update-dataset-permissions-with-apis).
|
|
383
406
|
- **Dataset query limits** (executeQueries API):
|
|
384
407
|
- Max **100,000 rows** or **1,000,000 values** (rows x columns) per query, whichever is hit first.
|
|
@@ -392,27 +415,23 @@ Hostname and site path inputs are normalized automatically:
|
|
|
392
415
|
|
|
393
416
|
## Examples
|
|
394
417
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
418
|
+
Runnable, placeholder-based scripts live in [`examples/`](./examples). Start
|
|
419
|
+
with the [examples guide](examples/README.md), then run a read-only example from
|
|
420
|
+
the repository root:
|
|
398
421
|
|
|
399
422
|
```bash
|
|
423
|
+
cp .env.example .env
|
|
400
424
|
python -m examples.workspaces
|
|
401
|
-
python -m examples.
|
|
425
|
+
python -m examples.dataflow_destinations
|
|
402
426
|
```
|
|
403
427
|
|
|
428
|
+
Write examples never perform a mutation when run directly. Edit the placeholder
|
|
429
|
+
values and call their explicit helper only after reviewing the target IDs.
|
|
430
|
+
|
|
404
431
|
---
|
|
405
432
|
|
|
406
433
|
## Contributing
|
|
407
434
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
2. Use `feature/<name>` / `fix/<name>` branches. Direct pushes to `main` are
|
|
412
|
-
blocked by repository rulesets.
|
|
413
|
-
3. Keep PRs focused. Add or update tests under `tests/` for any behavior change.
|
|
414
|
-
4. Run `pytest` locally before opening a PR; the `Collaboration` workflow runs
|
|
415
|
-
the same suite on every PR and must pass before merging.
|
|
416
|
-
|
|
417
|
-
PyPI releases are published automatically from `main` by the `Publish to PyPI`
|
|
418
|
-
workflow, gated by a manual approval on the `pypi` environment.
|
|
435
|
+
Read [Contributing](CONTRIBUTING.md) before opening a pull request. It links the
|
|
436
|
+
local setup, validation commands, issue and pull request process, branch
|
|
437
|
+
conventions, and release boundary.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|