msfabricpysdkcore 0.2.3__tar.gz → 0.2.5__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.
Files changed (83) hide show
  1. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/PKG-INFO +224 -23
  2. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/README.md +223 -22
  3. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/adminapi.py +114 -0
  4. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/coreapi.py +1235 -52
  5. msfabricpysdkcore-0.2.5/msfabricpysdkcore/deployment_pipeline.py +203 -0
  6. msfabricpysdkcore-0.2.5/msfabricpysdkcore/eventstream.py +68 -0
  7. msfabricpysdkcore-0.2.5/msfabricpysdkcore/folder.py +69 -0
  8. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/item.py +9 -0
  9. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/lakehouse.py +9 -1
  10. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/otheritems.py +59 -40
  11. msfabricpysdkcore-0.2.5/msfabricpysdkcore/tests/test_admin_tags.py +46 -0
  12. msfabricpysdkcore-0.2.5/msfabricpysdkcore/tests/test_copy_jobs.py +60 -0
  13. msfabricpysdkcore-0.2.5/msfabricpysdkcore/tests/test_dataflows.py +60 -0
  14. msfabricpysdkcore-0.2.5/msfabricpysdkcore/tests/test_datapipelines.py +60 -0
  15. msfabricpysdkcore-0.2.5/msfabricpysdkcore/tests/test_deployment_pipelinev2.py +135 -0
  16. msfabricpysdkcore-0.2.5/msfabricpysdkcore/tests/test_eventstream_topology.py +82 -0
  17. msfabricpysdkcore-0.2.5/msfabricpysdkcore/tests/test_folders.py +53 -0
  18. msfabricpysdkcore-0.2.5/msfabricpysdkcore/tests/test_tags.py +28 -0
  19. msfabricpysdkcore-0.2.5/msfabricpysdkcore/tests/test_variable_libary.py +61 -0
  20. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/workspace.py +354 -0
  21. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore.egg-info/PKG-INFO +224 -23
  22. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore.egg-info/SOURCES.txt +10 -0
  23. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/pyproject.toml +1 -1
  24. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/setup.py +1 -1
  25. msfabricpysdkcore-0.2.3/msfabricpysdkcore/deployment_pipeline.py +0 -130
  26. msfabricpysdkcore-0.2.3/msfabricpysdkcore/tests/test_datapipelines.py +0 -45
  27. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/LICENSE +0 -0
  28. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/__init__.py +0 -0
  29. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/admin_item.py +0 -0
  30. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/admin_workspace.py +0 -0
  31. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/auth.py +0 -0
  32. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/capacity.py +0 -0
  33. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/client.py +0 -0
  34. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/domain.py +0 -0
  35. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/environment.py +0 -0
  36. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/fabric_azure_capacity.py +0 -0
  37. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/fabric_azure_client.py +0 -0
  38. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/job_instance.py +0 -0
  39. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/long_running_operation.py +0 -0
  40. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/onelakeshortcut.py +0 -0
  41. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/spark_custom_pool.py +0 -0
  42. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/__init__.py +0 -0
  43. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_admin_apis.py +0 -0
  44. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_connection.py +0 -0
  45. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_deployment_pipeline.py +0 -0
  46. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_domains.py +0 -0
  47. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_environments.py +0 -0
  48. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_evenhouses.py +0 -0
  49. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_evenstreams.py +0 -0
  50. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_external_data_shares.py +0 -0
  51. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_fabric_azure_client.py +0 -0
  52. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_gateways.py +0 -0
  53. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_git.py +0 -0
  54. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_graphqlapi.py +0 -0
  55. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_items.py +0 -0
  56. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_jobs.py +0 -0
  57. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_kql_dashboards.py +0 -0
  58. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_kql_queryset.py +0 -0
  59. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_kqldatabases.py +0 -0
  60. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_lakehouse.py +0 -0
  61. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_managed_private_endpoints.py +0 -0
  62. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_mirroreddatabases.py +0 -0
  63. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_ml_experiments.py +0 -0
  64. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_ml_models.py +0 -0
  65. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_mounted_adf.py +0 -0
  66. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_notebooks.py +0 -0
  67. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_one_lake_data_access_security.py +0 -0
  68. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_other_items.py +0 -0
  69. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_reflex.py +0 -0
  70. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_reports.py +0 -0
  71. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_semantic_model.py +0 -0
  72. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_shortcuts.py +0 -0
  73. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_spark.py +0 -0
  74. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_sparkjobdefinition.py +0 -0
  75. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_sqldatabases.py +0 -0
  76. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_warehouses.py +0 -0
  77. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/tests/test_workspaces_capacities.py +0 -0
  78. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/util/__init__.py +0 -0
  79. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore/util/logger.py +0 -0
  80. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore.egg-info/dependency_links.txt +0 -0
  81. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore.egg-info/requires.txt +0 -0
  82. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/msfabricpysdkcore.egg-info/top_level.txt +0 -0
  83. {msfabricpysdkcore-0.2.3 → msfabricpysdkcore-0.2.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: msfabricpysdkcore
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Summary: A Python SDK for Microsoft Fabric
5
5
  Author: Andreas Rederer
6
6
  Project-URL: Homepage, https://github.com/DaSenf1860/ms-fabric-sdk-core
@@ -18,7 +18,7 @@ Dynamic: requires-dist
18
18
 
19
19
  # Python SDK for Microsoft Fabric
20
20
 
21
- This is a Python SDK for Microsoft Fabric. It is a wrapper around the REST APIs (v1) of Fabric*. It supports all Fabric REST APIs as well as Azure Resource Management APIs for Fabric (as of March 06, 2025).
21
+ This is a Python SDK for Microsoft Fabric. It is a wrapper around the REST APIs (v1) of Fabric*. It supports all Fabric REST APIs as well as Azure Resource Management APIs for Fabric (as of May 19, 2025).
22
22
 
23
23
  ![Python hugging a F](assets/fabricpythontransparent.png)
24
24
 
@@ -47,7 +47,9 @@ Currently it supports all Core APIs, Admin APIs, all item specific CRUD APIs and
47
47
  - [Capacities](#working-with-capacities)
48
48
  - [Connections](#connections)
49
49
  - [Deployment Pipelines](#deployment-pipelines)
50
- - [External Data Shares](#external-data-shares)
50
+ - [External Data Shares Provider](#external-data-shares-provider)
51
+ - [External Data Shares Recipient](#external-data-shares-recipient)
52
+ - [Folders](#folders)
51
53
  - [Gateways](#gateways)
52
54
  - [Git](#working-with-git)
53
55
  - [Items](#working-with-items)
@@ -56,12 +58,14 @@ Currently it supports all Core APIs, Admin APIs, all item specific CRUD APIs and
56
58
  - [Long Running Operations](#long-running-operations)
57
59
  - [OneLakeDataAccessSecurity](#one-lake-data-access-security)
58
60
  - [OneLakeShortcuts](#working-with-one-lake-shortcuts)
61
+ - [Tags](#tags)
59
62
  - [Workspaces](#working-with-workspaces)
60
63
  - Admin APIs
61
64
  - [Domains](#admin-api-for-domains)
62
65
  - [External Data Shares](#admin-api-for-external-data-shares)
63
66
  - [Items](#admin-api-for-items)
64
67
  - [Labels](#admin-api-for-labels)
68
+ - [Tags](#admin-api-for-tags)
65
69
  - [Tenants](#admin-api-for-tenants)
66
70
  - [Users](#admin-api-for-users)
67
71
  - [Workspaces](#admin-api-for-workspaces)
@@ -119,6 +123,8 @@ fc = FabricClientCore(tenant_id = "tenant_id",
119
123
 
120
124
  token = fc.get_token()
121
125
  ```
126
+
127
+
122
128
  ### Working with workspaces
123
129
 
124
130
  ```python
@@ -315,43 +321,112 @@ role_assi = fc.update_connection_role_assignment(connection_id="id",
315
321
  ### Deployment Pipelines
316
322
 
317
323
  ```python
324
+ from msfabricpysdkcore import FabricClientCore
318
325
 
326
+ fcc = FabricClientCore()
327
+ workspace_id = "72dasdfasdf56"
328
+
329
+ user_id = "e05sadfasfd23"
330
+ capacity_id = "9e7easdfasdf2a00"
331
+
332
+ prod_workspace = fcc.create_workspace("prodworkspace")
333
+ prod_workspace.assign_to_capacity(capacity_id)
334
+
335
+ stages = [
336
+ {
337
+ "displayName": "Development",
338
+ "description": "Development stage description",
339
+ "isPublic": False
340
+ },
341
+ {
342
+ "displayName": "Production",
343
+ "description": "Production stage description",
344
+ "isPublic":True
345
+ }
346
+ ]
319
347
 
320
- # List deployment pipelines
348
+ # Create deployment pipeline
349
+ pipe =fcc.create_deployment_pipeline(display_name="sdktestpipeline",
350
+ description="Test Deployment Pipeline Description",
351
+ stages=stages)
352
+ pipe_id = pipe.id
321
353
 
322
- depl_pipes = fc.list_deployment_pipelines()
354
+ for stage in pipe.stages:
355
+ if stage["displayName"] == "Development":
356
+ dev_stage = stage
357
+ else:
358
+ prod_stage = stage
323
359
 
324
- pipe = [pipe for pipe in depl_pipes if pipe.display_name == 'sdkpipe'][0]
325
- pipe_id = pipe.id
360
+ # Get deployment pipeline
361
+ stage = fcc.get_deployment_pipeline_stage(deployment_pipeline_id=pipe_id,
362
+ stage_id=dev_stage["id"])
326
363
 
327
- # Get a deployment pipeline
328
- pipe = fc.get_deployment_pipeline(pipe_id)
364
+ # Assign workspace to stage
365
+ resp = fcc.assign_workspace_to_stage(deployment_pipeline_id=pipe_id,
366
+ stage_id=dev_stage["id"],
367
+ workspace_id=workspace_id)
329
368
 
330
369
 
331
- # Get deployment pipeline stages
332
- stages = fc.list_deployment_pipeline_stages(pipe_id)
370
+ resp = fcc.assign_workspace_to_stage(deployment_pipeline_id=pipe_id,
371
+ stage_id=prod_stage["id"],
372
+ workspace_id=prod_workspace.id)
333
373
 
334
- names = [stage.display_name for stage in stages]
374
+ # Add deployment pipeline role assignment
375
+ principal = {
376
+ "id": user_id,
377
+ "type": "User"
378
+ }
335
379
 
336
- dev_stage = [stage for stage in stages if stage.display_name == "Development"][0]
337
- prod_stage = [stage for stage in stages if stage.display_name == "Production"][0]
380
+ resp = fcc.add_deployment_pipeline_role_assignment(deployment_pipeline_id=pipe_id,principal=principal, role="Admin")
338
381
 
339
- # Get deployment pipeline stages items
340
- items = fc.list_deployment_pipeline_stages_items(pipeline_id=pipe_id, stage_id=dev_stage.id)
382
+ # List deployment pipeline role assignments
383
+ roles = fcc.list_deployment_pipeline_role_assignments(deployment_pipeline_id=pipe_id)
341
384
 
385
+ # Delete deployment pipeline role assignment
386
+ resp = fcc.delete_deployment_pipeline_role_assignment(deployment_pipeline_id=pipe_id, principal_id=user_id)
342
387
 
343
- items = [item for item in dev_stage.get_items() if item["itemDisplayName"] == 'cicdlakehouse']
344
- item = items[0]
345
- item = {"sourceItemId": item["itemId"],
346
- "itemType": item["itemType"]}
347
- items = [item]
388
+ # List deployment pipelines
389
+ pipes = fcc.list_deployment_pipelines(with_details=False)
390
+ sdk_pipes = [pipe for pipe in pipes if "sdk" in pipe["displayName"]]
348
391
 
349
392
  # Deploy stage content
350
- response = pipe.deploy(source_stage_id=dev_stage.id,target_stage_id=prod_stage.id, items=items)
393
+ resp = fcc.deploy_stage_content(deployment_pipeline_id=pipe_id,
394
+ source_stage_id=dev_stage["id"],
395
+ target_stage_id=prod_stage["id"], wait_for_completion=False)
396
+
397
+ # List deployment pipeline operations
398
+ ops = fcc.list_deployment_pipeline_operations(deployment_pipeline_id=pipe_id)
399
+
400
+ # Get deployment pipeline operation
401
+ ops = fcc.get_deployment_pipeline_operation(deployment_pipeline_id=pipe_id, operation_id=ops[0]["id"])
351
402
 
403
+ # List deployment pipeline stages
404
+ stages = fcc.list_deployment_pipeline_stages(deployment_pipeline_id=pipe_id)
405
+
406
+ # List deployment pipeline stage items
407
+ items = fcc.list_deployment_pipeline_stage_items(deployment_pipeline_id=pipe_id, stage_id=dev_stage["id"])
408
+
409
+ # Update deployment pipeline
410
+ updated_pipe = fcc.update_deployment_pipeline(deployment_pipeline_id=pipe.id, display_name="sdknewname", description="newdescription")
411
+
412
+ # Get deployment pipeline
413
+ pipe = fcc.get_deployment_pipeline(pipe_id)
414
+
415
+ # Update deployment pipeline stage
416
+ updated_stage = fcc.update_deployment_pipeline_stage(deployment_pipeline_id=pipe_id, stage_id=prod_stage["id"],
417
+ display_name="newname", description="newdescription")
418
+
419
+ # Get deployment pipeline stage
420
+ stage = fcc.get_deployment_pipeline_stage(deployment_pipeline_id=pipe_id, stage_id=prod_stage["id"])
421
+
422
+ # Unassign workspace from stage
423
+ resp = fcc.unassign_workspace_from_stage(deployment_pipeline_id=pipe_id,stage_id=prod_stage["id"])
424
+
425
+ # Delete deployment pipeline
426
+ resp = fcc.delete_deployment_pipeline(deployment_pipeline_id=pipe_id)
352
427
  ```
353
428
 
354
- ### External Data Shares
429
+ ### External Data Shares Provider
355
430
 
356
431
  ```python
357
432
  from msfabricpysdkcore.coreapi import FabricClientCore
@@ -387,6 +462,36 @@ response_code = fc.revoke_external_data_share(workspace_id, item_id, data_share[
387
462
 
388
463
  ```
389
464
 
465
+ ### External Data Shares Recipient
466
+
467
+ ```python
468
+ from msfabricpysdkcore.coreapi import FabricClientCore
469
+ fcc = FabricClientCore()
470
+
471
+ # Accept external data share invitation
472
+ invitation_id = "adfasdfsd"
473
+ workspace_id = "asdfsdf"
474
+ item_id = "asdfsdf"
475
+ provider_tenant_id = "asdfsdf"
476
+ payload = {
477
+ "payloadType": "ShortcutCreation",
478
+ "path": "Files/DataFromContoso",
479
+ "createShortcutRequests": [
480
+ {
481
+ "pathId": "5c95314c-ef86-4663-9f1e-dee186f38715",
482
+ "shortcutName": "Shortcut_To_Contoso_Sales_2023"
483
+ },
484
+ {
485
+ "pathId": "6c95314c-ef86-4663-9f1e-dee186f38716",
486
+ "shortcutName": "Shortcut_To_Contoso_Sales_2024"
487
+ }
488
+ ]
489
+ }
490
+ obj = fcc.accept_external_data_share_invitation(invitation_id=invitation_id, item_id=item_id,payload=payload, provider_tenant_id=provider_tenant_id,workspace_id=workspace_id):
491
+
492
+ # Get external data share invitation details
493
+ details = fcc.get_external_data_share_invitation(invitation_id=invitation_id, provider_tenant_id=provider_tenant_id)
494
+ ```
390
495
 
391
496
  ### Working with items
392
497
 
@@ -434,6 +539,36 @@ ws.delete_item(item_id="item_id")
434
539
  # or
435
540
  item.delete()
436
541
 
542
+ ```
543
+
544
+ ### Folders
545
+ ```python
546
+ from msfabricpysdkcore import FabricClientCore
547
+ fcc = FabricClientCore()
548
+
549
+
550
+ workspace_id = "asdfasfd"
551
+ folder_id = "asdfasdff"
552
+
553
+ # Create a folder
554
+ folder = fcc.create_folder(workspace_id=workspace_id, display_name="sdk_sub_folder", parent_folder_id=folder_id)
555
+
556
+ # Get a folder
557
+ folder_ = fcc.get_folder(workspace_id=workspace_id, folder_id=folder.id)
558
+
559
+ # List folders
560
+ folders = fcc.list_folders(workspace_id=workspace_id)
561
+
562
+ # Update a folder
563
+ folder = fcc.update_folder(workspace_id=workspace_id, folder_id=folder.id, display_name="sdk_sub_folder_updated")
564
+
565
+ # Move a folder
566
+ folder = fcc.move_folder(workspace_id=workspace_id, folder_id=folder.id)
567
+
568
+ # Delete a folder
569
+ fcc.delete_folder(workspace_id=workspace_id, folder_id=folder.id)
570
+
571
+
437
572
  ```
438
573
 
439
574
  ### Gateways
@@ -641,6 +776,24 @@ fc.reset_shortcut_cache(workspace_id="23232", wait_for_completion = False)
641
776
 
642
777
  ```
643
778
 
779
+ ### Tags
780
+
781
+ ```python
782
+ from msfabricpysdkcore import FabricClientCore
783
+ fcc = FabricClientCore()
784
+
785
+ # List tags
786
+ tags = fcc.list_tags()
787
+
788
+ tag_ids = [tag["id"] for tag in tags]
789
+
790
+ # Apply tags
791
+ resp = fcc.apply_tags(workspace_id = "adsfsdf", item_id = "a9e59ec1-524b-49b1-a185-37e47dc0ceb9", tags = tag_ids)
792
+
793
+ # Unapply tags
794
+ resp = fcc.unapply_tags(workspace_id = "adsfsdf", item_id = "a9e59ec1-524b-49b1-a185-37e47dc0ceb9", tags = tag_ids)
795
+
796
+ ```
644
797
 
645
798
  ### Working with job scheduler
646
799
 
@@ -822,6 +975,54 @@ access_entities = fca.list_access_entities(user_id, type="Notebook")
822
975
 
823
976
  ```
824
977
 
978
+ ### Admin API for Sharing Links
979
+
980
+ ```python
981
+ from msfabricpysdkcore import FabricClientAdmin
982
+ fca = FabricClientAdmin()
983
+
984
+ items = [
985
+ {
986
+ "id": "fe472f5e-636e-4c10-a1c6-7e9edc0b542a",
987
+ "type": "Report"
988
+ },
989
+ {
990
+ "id": "476fcafe-b514-495d-b13f-ca9a4f0b1d8b",
991
+ "type": "Report"
992
+ }]
993
+
994
+ # Bulk remove sharing links
995
+ fca.bulk_remove_sharing_links(items = items, sharing_link_type = "OrgLink")
996
+
997
+ # Remove all sharing links
998
+ fca.remove_all_sharing_links(sharing_link_type = "OrgLink")
999
+ ```
1000
+
1001
+ ### Admin API for Tags
1002
+
1003
+ ```python
1004
+
1005
+ from msfabricpysdkcore import FabricClientAdmin
1006
+
1007
+ fca = FabricClientAdmin()
1008
+
1009
+ # Bulk create tags
1010
+ new_tags = [{"displayName": "sdk_tag_temp"}]
1011
+ resp = fca.bulk_create_tags(create_tags_request=new_tags)
1012
+
1013
+ # Delete tag
1014
+ fca.delete_tag(tag_id="adsfasdf")
1015
+
1016
+ # List tags
1017
+ tag_list = fca.list_tags()
1018
+
1019
+ # Update Tag
1020
+ updated_tag = fca.update_tag(tag_id="adsfasdf", display_name="sdk_tag_updated")
1021
+
1022
+
1023
+ ```
1024
+
1025
+
825
1026
  ### Admin API for Tenants
826
1027
 
827
1028
  ```python
@@ -1,6 +1,6 @@
1
1
  # Python SDK for Microsoft Fabric
2
2
 
3
- This is a Python SDK for Microsoft Fabric. It is a wrapper around the REST APIs (v1) of Fabric*. It supports all Fabric REST APIs as well as Azure Resource Management APIs for Fabric (as of March 06, 2025).
3
+ This is a Python SDK for Microsoft Fabric. It is a wrapper around the REST APIs (v1) of Fabric*. It supports all Fabric REST APIs as well as Azure Resource Management APIs for Fabric (as of May 19, 2025).
4
4
 
5
5
  ![Python hugging a F](assets/fabricpythontransparent.png)
6
6
 
@@ -29,7 +29,9 @@ Currently it supports all Core APIs, Admin APIs, all item specific CRUD APIs and
29
29
  - [Capacities](#working-with-capacities)
30
30
  - [Connections](#connections)
31
31
  - [Deployment Pipelines](#deployment-pipelines)
32
- - [External Data Shares](#external-data-shares)
32
+ - [External Data Shares Provider](#external-data-shares-provider)
33
+ - [External Data Shares Recipient](#external-data-shares-recipient)
34
+ - [Folders](#folders)
33
35
  - [Gateways](#gateways)
34
36
  - [Git](#working-with-git)
35
37
  - [Items](#working-with-items)
@@ -38,12 +40,14 @@ Currently it supports all Core APIs, Admin APIs, all item specific CRUD APIs and
38
40
  - [Long Running Operations](#long-running-operations)
39
41
  - [OneLakeDataAccessSecurity](#one-lake-data-access-security)
40
42
  - [OneLakeShortcuts](#working-with-one-lake-shortcuts)
43
+ - [Tags](#tags)
41
44
  - [Workspaces](#working-with-workspaces)
42
45
  - Admin APIs
43
46
  - [Domains](#admin-api-for-domains)
44
47
  - [External Data Shares](#admin-api-for-external-data-shares)
45
48
  - [Items](#admin-api-for-items)
46
49
  - [Labels](#admin-api-for-labels)
50
+ - [Tags](#admin-api-for-tags)
47
51
  - [Tenants](#admin-api-for-tenants)
48
52
  - [Users](#admin-api-for-users)
49
53
  - [Workspaces](#admin-api-for-workspaces)
@@ -101,6 +105,8 @@ fc = FabricClientCore(tenant_id = "tenant_id",
101
105
 
102
106
  token = fc.get_token()
103
107
  ```
108
+
109
+
104
110
  ### Working with workspaces
105
111
 
106
112
  ```python
@@ -297,43 +303,112 @@ role_assi = fc.update_connection_role_assignment(connection_id="id",
297
303
  ### Deployment Pipelines
298
304
 
299
305
  ```python
306
+ from msfabricpysdkcore import FabricClientCore
300
307
 
308
+ fcc = FabricClientCore()
309
+ workspace_id = "72dasdfasdf56"
310
+
311
+ user_id = "e05sadfasfd23"
312
+ capacity_id = "9e7easdfasdf2a00"
313
+
314
+ prod_workspace = fcc.create_workspace("prodworkspace")
315
+ prod_workspace.assign_to_capacity(capacity_id)
316
+
317
+ stages = [
318
+ {
319
+ "displayName": "Development",
320
+ "description": "Development stage description",
321
+ "isPublic": False
322
+ },
323
+ {
324
+ "displayName": "Production",
325
+ "description": "Production stage description",
326
+ "isPublic":True
327
+ }
328
+ ]
301
329
 
302
- # List deployment pipelines
330
+ # Create deployment pipeline
331
+ pipe =fcc.create_deployment_pipeline(display_name="sdktestpipeline",
332
+ description="Test Deployment Pipeline Description",
333
+ stages=stages)
334
+ pipe_id = pipe.id
303
335
 
304
- depl_pipes = fc.list_deployment_pipelines()
336
+ for stage in pipe.stages:
337
+ if stage["displayName"] == "Development":
338
+ dev_stage = stage
339
+ else:
340
+ prod_stage = stage
305
341
 
306
- pipe = [pipe for pipe in depl_pipes if pipe.display_name == 'sdkpipe'][0]
307
- pipe_id = pipe.id
342
+ # Get deployment pipeline
343
+ stage = fcc.get_deployment_pipeline_stage(deployment_pipeline_id=pipe_id,
344
+ stage_id=dev_stage["id"])
308
345
 
309
- # Get a deployment pipeline
310
- pipe = fc.get_deployment_pipeline(pipe_id)
346
+ # Assign workspace to stage
347
+ resp = fcc.assign_workspace_to_stage(deployment_pipeline_id=pipe_id,
348
+ stage_id=dev_stage["id"],
349
+ workspace_id=workspace_id)
311
350
 
312
351
 
313
- # Get deployment pipeline stages
314
- stages = fc.list_deployment_pipeline_stages(pipe_id)
352
+ resp = fcc.assign_workspace_to_stage(deployment_pipeline_id=pipe_id,
353
+ stage_id=prod_stage["id"],
354
+ workspace_id=prod_workspace.id)
315
355
 
316
- names = [stage.display_name for stage in stages]
356
+ # Add deployment pipeline role assignment
357
+ principal = {
358
+ "id": user_id,
359
+ "type": "User"
360
+ }
317
361
 
318
- dev_stage = [stage for stage in stages if stage.display_name == "Development"][0]
319
- prod_stage = [stage for stage in stages if stage.display_name == "Production"][0]
362
+ resp = fcc.add_deployment_pipeline_role_assignment(deployment_pipeline_id=pipe_id,principal=principal, role="Admin")
320
363
 
321
- # Get deployment pipeline stages items
322
- items = fc.list_deployment_pipeline_stages_items(pipeline_id=pipe_id, stage_id=dev_stage.id)
364
+ # List deployment pipeline role assignments
365
+ roles = fcc.list_deployment_pipeline_role_assignments(deployment_pipeline_id=pipe_id)
323
366
 
367
+ # Delete deployment pipeline role assignment
368
+ resp = fcc.delete_deployment_pipeline_role_assignment(deployment_pipeline_id=pipe_id, principal_id=user_id)
324
369
 
325
- items = [item for item in dev_stage.get_items() if item["itemDisplayName"] == 'cicdlakehouse']
326
- item = items[0]
327
- item = {"sourceItemId": item["itemId"],
328
- "itemType": item["itemType"]}
329
- items = [item]
370
+ # List deployment pipelines
371
+ pipes = fcc.list_deployment_pipelines(with_details=False)
372
+ sdk_pipes = [pipe for pipe in pipes if "sdk" in pipe["displayName"]]
330
373
 
331
374
  # Deploy stage content
332
- response = pipe.deploy(source_stage_id=dev_stage.id,target_stage_id=prod_stage.id, items=items)
375
+ resp = fcc.deploy_stage_content(deployment_pipeline_id=pipe_id,
376
+ source_stage_id=dev_stage["id"],
377
+ target_stage_id=prod_stage["id"], wait_for_completion=False)
378
+
379
+ # List deployment pipeline operations
380
+ ops = fcc.list_deployment_pipeline_operations(deployment_pipeline_id=pipe_id)
381
+
382
+ # Get deployment pipeline operation
383
+ ops = fcc.get_deployment_pipeline_operation(deployment_pipeline_id=pipe_id, operation_id=ops[0]["id"])
333
384
 
385
+ # List deployment pipeline stages
386
+ stages = fcc.list_deployment_pipeline_stages(deployment_pipeline_id=pipe_id)
387
+
388
+ # List deployment pipeline stage items
389
+ items = fcc.list_deployment_pipeline_stage_items(deployment_pipeline_id=pipe_id, stage_id=dev_stage["id"])
390
+
391
+ # Update deployment pipeline
392
+ updated_pipe = fcc.update_deployment_pipeline(deployment_pipeline_id=pipe.id, display_name="sdknewname", description="newdescription")
393
+
394
+ # Get deployment pipeline
395
+ pipe = fcc.get_deployment_pipeline(pipe_id)
396
+
397
+ # Update deployment pipeline stage
398
+ updated_stage = fcc.update_deployment_pipeline_stage(deployment_pipeline_id=pipe_id, stage_id=prod_stage["id"],
399
+ display_name="newname", description="newdescription")
400
+
401
+ # Get deployment pipeline stage
402
+ stage = fcc.get_deployment_pipeline_stage(deployment_pipeline_id=pipe_id, stage_id=prod_stage["id"])
403
+
404
+ # Unassign workspace from stage
405
+ resp = fcc.unassign_workspace_from_stage(deployment_pipeline_id=pipe_id,stage_id=prod_stage["id"])
406
+
407
+ # Delete deployment pipeline
408
+ resp = fcc.delete_deployment_pipeline(deployment_pipeline_id=pipe_id)
334
409
  ```
335
410
 
336
- ### External Data Shares
411
+ ### External Data Shares Provider
337
412
 
338
413
  ```python
339
414
  from msfabricpysdkcore.coreapi import FabricClientCore
@@ -369,6 +444,36 @@ response_code = fc.revoke_external_data_share(workspace_id, item_id, data_share[
369
444
 
370
445
  ```
371
446
 
447
+ ### External Data Shares Recipient
448
+
449
+ ```python
450
+ from msfabricpysdkcore.coreapi import FabricClientCore
451
+ fcc = FabricClientCore()
452
+
453
+ # Accept external data share invitation
454
+ invitation_id = "adfasdfsd"
455
+ workspace_id = "asdfsdf"
456
+ item_id = "asdfsdf"
457
+ provider_tenant_id = "asdfsdf"
458
+ payload = {
459
+ "payloadType": "ShortcutCreation",
460
+ "path": "Files/DataFromContoso",
461
+ "createShortcutRequests": [
462
+ {
463
+ "pathId": "5c95314c-ef86-4663-9f1e-dee186f38715",
464
+ "shortcutName": "Shortcut_To_Contoso_Sales_2023"
465
+ },
466
+ {
467
+ "pathId": "6c95314c-ef86-4663-9f1e-dee186f38716",
468
+ "shortcutName": "Shortcut_To_Contoso_Sales_2024"
469
+ }
470
+ ]
471
+ }
472
+ obj = fcc.accept_external_data_share_invitation(invitation_id=invitation_id, item_id=item_id,payload=payload, provider_tenant_id=provider_tenant_id,workspace_id=workspace_id):
473
+
474
+ # Get external data share invitation details
475
+ details = fcc.get_external_data_share_invitation(invitation_id=invitation_id, provider_tenant_id=provider_tenant_id)
476
+ ```
372
477
 
373
478
  ### Working with items
374
479
 
@@ -416,6 +521,36 @@ ws.delete_item(item_id="item_id")
416
521
  # or
417
522
  item.delete()
418
523
 
524
+ ```
525
+
526
+ ### Folders
527
+ ```python
528
+ from msfabricpysdkcore import FabricClientCore
529
+ fcc = FabricClientCore()
530
+
531
+
532
+ workspace_id = "asdfasfd"
533
+ folder_id = "asdfasdff"
534
+
535
+ # Create a folder
536
+ folder = fcc.create_folder(workspace_id=workspace_id, display_name="sdk_sub_folder", parent_folder_id=folder_id)
537
+
538
+ # Get a folder
539
+ folder_ = fcc.get_folder(workspace_id=workspace_id, folder_id=folder.id)
540
+
541
+ # List folders
542
+ folders = fcc.list_folders(workspace_id=workspace_id)
543
+
544
+ # Update a folder
545
+ folder = fcc.update_folder(workspace_id=workspace_id, folder_id=folder.id, display_name="sdk_sub_folder_updated")
546
+
547
+ # Move a folder
548
+ folder = fcc.move_folder(workspace_id=workspace_id, folder_id=folder.id)
549
+
550
+ # Delete a folder
551
+ fcc.delete_folder(workspace_id=workspace_id, folder_id=folder.id)
552
+
553
+
419
554
  ```
420
555
 
421
556
  ### Gateways
@@ -623,6 +758,24 @@ fc.reset_shortcut_cache(workspace_id="23232", wait_for_completion = False)
623
758
 
624
759
  ```
625
760
 
761
+ ### Tags
762
+
763
+ ```python
764
+ from msfabricpysdkcore import FabricClientCore
765
+ fcc = FabricClientCore()
766
+
767
+ # List tags
768
+ tags = fcc.list_tags()
769
+
770
+ tag_ids = [tag["id"] for tag in tags]
771
+
772
+ # Apply tags
773
+ resp = fcc.apply_tags(workspace_id = "adsfsdf", item_id = "a9e59ec1-524b-49b1-a185-37e47dc0ceb9", tags = tag_ids)
774
+
775
+ # Unapply tags
776
+ resp = fcc.unapply_tags(workspace_id = "adsfsdf", item_id = "a9e59ec1-524b-49b1-a185-37e47dc0ceb9", tags = tag_ids)
777
+
778
+ ```
626
779
 
627
780
  ### Working with job scheduler
628
781
 
@@ -804,6 +957,54 @@ access_entities = fca.list_access_entities(user_id, type="Notebook")
804
957
 
805
958
  ```
806
959
 
960
+ ### Admin API for Sharing Links
961
+
962
+ ```python
963
+ from msfabricpysdkcore import FabricClientAdmin
964
+ fca = FabricClientAdmin()
965
+
966
+ items = [
967
+ {
968
+ "id": "fe472f5e-636e-4c10-a1c6-7e9edc0b542a",
969
+ "type": "Report"
970
+ },
971
+ {
972
+ "id": "476fcafe-b514-495d-b13f-ca9a4f0b1d8b",
973
+ "type": "Report"
974
+ }]
975
+
976
+ # Bulk remove sharing links
977
+ fca.bulk_remove_sharing_links(items = items, sharing_link_type = "OrgLink")
978
+
979
+ # Remove all sharing links
980
+ fca.remove_all_sharing_links(sharing_link_type = "OrgLink")
981
+ ```
982
+
983
+ ### Admin API for Tags
984
+
985
+ ```python
986
+
987
+ from msfabricpysdkcore import FabricClientAdmin
988
+
989
+ fca = FabricClientAdmin()
990
+
991
+ # Bulk create tags
992
+ new_tags = [{"displayName": "sdk_tag_temp"}]
993
+ resp = fca.bulk_create_tags(create_tags_request=new_tags)
994
+
995
+ # Delete tag
996
+ fca.delete_tag(tag_id="adsfasdf")
997
+
998
+ # List tags
999
+ tag_list = fca.list_tags()
1000
+
1001
+ # Update Tag
1002
+ updated_tag = fca.update_tag(tag_id="adsfasdf", display_name="sdk_tag_updated")
1003
+
1004
+
1005
+ ```
1006
+
1007
+
807
1008
  ### Admin API for Tenants
808
1009
 
809
1010
  ```python