msfabricpysdkcore 0.0.2__py3-none-any.whl → 0.0.4__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: msfabricpysdkcore
3
- Version: 0.0.2
3
+ Version: 0.0.4
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
@@ -13,9 +13,9 @@ License-File: LICENSE
13
13
  Requires-Dist: requests >=2.30.0
14
14
  Requires-Dist: azure-identity >=1.15.0
15
15
 
16
- # A Python SDK for Microsoft Fabric
16
+ # Python SDK for Microsoft Fabric
17
17
 
18
- This is a Python SDK for Microsoft Fabric. It is a wrapper around the REST APIs of Fabric*.
18
+ This is a Python SDK for Microsoft Fabric. It is a wrapper around the REST APIs (v1) of Fabric*.
19
19
 
20
20
  ![Python hugging a F](assets/fabricpythontransparent.png)
21
21
 
@@ -29,24 +29,35 @@ Additionally it brings some extra features like:
29
29
  - Retry logic when hitting the API rate limits
30
30
  - Referencing objects by name instead of ID
31
31
  - More granular objects, e.g. a Workspace and Item object instead of referencing IDs all the time
32
- - Do bulk operations**
33
- - Pagination support**
34
-
35
- Currently it supports all Core APIs, i.e.:
36
- - [Capacities](#working-with-capacities)
37
- - [Git](#working-with-git)
38
- - [Items](#working-with-items)
39
- - [Job Scheduler](#working-with-job-scheduler)
40
- - Long Running Operations
41
- - [OneLakeShortcuts](#working-with-one-lake-shortcuts)
42
- - [Workspaces](#working-with-workspaces)
43
-
44
- It is planned to support also the Admin and Lakehouse APIs and new APIs which are not released yet.
32
+ - Do bulk operations (see [Usage Patterns](usage_patterns.md))
33
+ - Pagination support
34
+
35
+ See the latest release notes [here](releasenotes/release_notes.md).
36
+
37
+ Currently it supports all Core APIs, Admin APIs and Lakehouse APIs, i.e.:
38
+ - Core APIs
39
+ - [Capacities](#working-with-capacities)
40
+ - [Git](#working-with-git)
41
+ - [Items](#working-with-items)
42
+ - [Job Scheduler](#working-with-job-scheduler)
43
+ - Long Running Operations
44
+ - [OneLakeShortcuts](#working-with-one-lake-shortcuts)
45
+ - [Workspaces](#working-with-workspaces)
46
+ - Lakehouse APIs
47
+ - [Tables](#tables)
48
+ - Admin APIs
49
+ - [Domains](#admin-api-for-domains)
50
+ - [Items](#admin-api-for-items)
51
+ - [Tenants](#admin-api-for-tenants)
52
+ - [Users](#admin-api-for-users)
53
+ - [Workspaces](#admin-api-for-workspaces)
54
+
55
+ It is planned to support also the APIs of the user experiences and new APIs which are not released yet.
56
+ Also we have plans to support APIs to interact with Fabric capacities on the Azure Side.
45
57
  Eventually Power BI APIs like the Scanner API will be covered as well.
46
58
 
47
59
  *Because this SDK uses the API in the background, all limitations and restrictions of the API apply to this SDK as well. This includes rate limits, permissions, etc.
48
60
 
49
- **These features are not yet implemented but are planned for the near future.
50
61
 
51
62
 
52
63
 
@@ -160,11 +171,16 @@ ws.delete_role_assignment(principal_id = "abadfbafb")
160
171
 
161
172
  ```python
162
173
 
174
+
175
+ capacity_object = fc.get_capacity(capacity_id = "0129389012u8938491")
176
+ #or
177
+ capacity_object = fc.get_capacity(capacity_name = "sandboxcapacitygermanywc")
178
+
163
179
  # Assign a capaycity to a workspace
164
180
  fc.assign_to_capacity(workspace_id=workspace_id,
165
- capacity_id="capacityid123123")
181
+ capacity_id=capacity_object.id)
166
182
  # or
167
- ws.assign_to_capacity(capacity_id="capacityid123123")
183
+ ws.assign_to_capacity(capacity_id=capacity_object.id)
168
184
 
169
185
  # Unassign from capacity
170
186
  fc.unassign_from_capacity(workspace_id=ws.id)
@@ -359,6 +375,172 @@ item.cancel_item_job_instance(job_instance_id="job_instance_id")
359
375
 
360
376
  ```
361
377
 
378
+ ### Tables
379
+
380
+
381
+
382
+ ```python
383
+ # List tables in a Lakehouse
384
+
385
+ from msfabricpysdkcore import FabricClientCore
386
+
387
+ fc = FabricClientCore()
388
+ ws = fc.get_workspace_by_name("testworkspace")
389
+ lakehouse = ws.get_item_by_name(item_name="lakehouse1", item_type="Lakehouse")
390
+ table_list = lakehouse.list_tables()
391
+ # or
392
+ table_list = ws.list_tables(item_id = "someitemid")
393
+ # or
394
+ table_list = fc.list_tables(workspace_id = "someworkspaceid", item_id = "someitemid")
395
+
396
+
397
+ # Load a file (like a csv) into a Lakehouse table
398
+
399
+ lakehouse.load_table(table_name="testtable", path_type= "File", relative_path="Files/folder1/titanic.csv")
400
+ # or
401
+ ws.load_table(item_id = "someitemid", table_name="testtable",
402
+ path_type= "File", relative_path="Files/folder1/titanic.csv")
403
+ # or
404
+ fc.load_table(workspace_id = "someworkspaceid", item_id = "someitemid", table_name="testtable",
405
+ path_type= "File", relative_path="Files/folder1/titanic.csv")
406
+
407
+ ```
408
+
409
+ ### Admin API for Workspaces
410
+
411
+ ```python
412
+ from msfabricpysdkcore import FabricClientAdmin
413
+
414
+ fca = FabricClientAdmin()
415
+
416
+
417
+ # List workspaces
418
+ ws = fca.list_workspaces(name="testworkspace")[0]
419
+
420
+ # Get workspace
421
+ ws = fca.get_workspace(workspace_id="workspace_id")
422
+
423
+ # Get workspace access details
424
+
425
+ ws_access = fca.get_workspace_access_details("workspace_id")
426
+ # or
427
+ ws_access = ws.get_access_details()
428
+ ```
429
+
430
+ ### Admin API for Users
431
+
432
+ ```python
433
+ from msfabricpysdkcore import FabricClientAdmin
434
+
435
+ fca = FabricClientAdmin()
436
+
437
+ # Get access entities
438
+
439
+ user_id = 'b4fuhaidc2'
440
+ access_entities = fca.get_access_entities(user_id, type="Notebook")
441
+
442
+ ```
443
+
444
+ ### Admin API for Tenants
445
+
446
+ ```python
447
+ from msfabricpysdkcore import FabricClientAdmin
448
+
449
+ fca = FabricClientAdmin()
450
+
451
+ # Get tenant settings
452
+
453
+ tenant_settings = fca.get_tenant_settings()
454
+
455
+ # Get capacity tenant settings overrides
456
+
457
+ overrides = fca.get_capacities_tenant_settings_overrides()
458
+
459
+ ```
460
+
461
+ ### Admin API for Items
462
+
463
+ ```python
464
+ from msfabricpysdkcore import FabricClientAdmin
465
+
466
+ fca = FabricClientAdmin()
467
+
468
+ # List items
469
+
470
+ item_list = fca.list_items(workspace_id="wsid")
471
+
472
+ # Get item
473
+
474
+ item = fca.get_item(workspace_id="wsid", item_id=item_list[0].id)
475
+ # or
476
+ item = ws.get_item(item_id=item_list[0].id)
477
+
478
+ # Get item access details
479
+
480
+ item_access = fca.get_item_access_details(workspace_id="wsid", item_id=item_list[0].id)
481
+ #or
482
+ item_access = ws.get_item_access_details(item_id=item_list[0].id)
483
+ # or
484
+ item_access = item.get_access_details()
485
+
486
+ ```
487
+
488
+ ### Admin API for Domains
489
+
490
+ ```python
491
+ from msfabricpysdkcore import FabricClientAdmin
492
+
493
+ fca = FabricClientAdmin()
494
+
495
+ # Create domain
496
+ domain_name = "sdktestdomains"
497
+ domain = fca.create_domain(display_name=domain_name)
498
+
499
+ # Get domain by name
500
+ domain_clone = fca.get_domain_by_name(domain_name)
501
+
502
+ # Get domain by id
503
+ domain_clone = fca.get_domain_by_id(domain.id)
504
+
505
+ # List domains
506
+ domains = fca.list_domains()
507
+
508
+ # Update domain
509
+ domain_new_name = "sdktestdomains2"
510
+ domain_clone = fca.update_domain(domain.id, display_name=domain_new_name)
511
+
512
+ # Assign domain workspaces by Ids
513
+ fca.assign_domain_workspaces_by_ids(domain.id, ["workspace_id_1", "workspace_id_2"])
514
+
515
+ # List domain workspaces
516
+ workspaces = fca.list_domain_workspaces(domain.id, workspace_objects=True)
517
+
518
+ # Unassign domain workspaces by ids
519
+ status_code = fca.unassign_domain_workspaces_by_ids(domain.id, ["workspace_id_1", "workspace_id_2"])
520
+
521
+ # Assign domain workspaces by capacities
522
+ status_code = fca.assign_domain_workspaces_by_capacities(domain.id, ["cap_id1", "cap_id2"])
523
+
524
+ # Unassign all domain workspaces
525
+ status_code = fca.unassign_all_domain_workspaces(domain.id)
526
+
527
+ # Assign domain workspaces by principals
528
+ principal1 = {'id': '6edbsdfbfdgdf656', 'type': 'User'}
529
+ principal2 = {'id': '6eyxcbyyxc57', 'type': 'User'}
530
+
531
+ status_code = fca.assign_domains_workspaces_by_principals(domain.id, [principal1, principal2], wait_for_completion=True)
532
+
533
+ # Role assignments bulk assign
534
+
535
+ principals = [principal, principal_2]
536
+ status_code = fca.role_assignments_bulk_assign(domain.id, "Contributors", principals)
537
+
538
+ # Role assignments bulk unassign
539
+ status_code = fca.role_assignments_bulk_unassign(domain.id, "Contributors", [principal_2])
540
+
541
+ # Delete domain
542
+ status_code = fca.delete_domain(domain.id)
543
+ ```
362
544
 
363
545
 
364
546
  Note: This SDK is not an official SDK from Microsoft. It is a community project and not supported by Microsoft. Use it at your own risk.
@@ -0,0 +1,28 @@
1
+ msfabricpysdkcore/__init__.py,sha256=nh8-lxdMBWYSbQpbRxWkn3ZRpGipmQplTudjskN2l88,78
2
+ msfabricpysdkcore/admin_item.py,sha256=YfZiNAwqojwxSLsHXmYG_uO6_ILIQqLsOVh79HeWsuw,3778
3
+ msfabricpysdkcore/admin_workspace.py,sha256=OtBI7EWOa44rgIdIDG9dU2l-nMRYpOeIaoP5BPHKUPA,4248
4
+ msfabricpysdkcore/adminapi.py,sha256=YzK3s-CoFkzwOXrWPxoUeXFpv16ZwNujieaZI63bhqI,21039
5
+ msfabricpysdkcore/auth.py,sha256=1t5prgSg2hK7vMutif2lxHOQk_qTo3152h3FMof3y_4,1929
6
+ msfabricpysdkcore/capacity.py,sha256=Q_2-XrZtdf9F67fY0qU3D0ocEOGQq4KtIXAv9dXjQhI,1761
7
+ msfabricpysdkcore/client.py,sha256=XVa9xndx-b2f7rA8zR-9fXyon1Ig1MmSwIMNXDfUdhw,1060
8
+ msfabricpysdkcore/coreapi.py,sha256=uQLBgght07CcRZbliUORq-EN1SJYtLOSYWjX8jAo4wA,14367
9
+ msfabricpysdkcore/domain.py,sha256=i8jMJEutDRL5XuQ69woCVQEzLS_lm9uUxl4Kp3xtxHc,14722
10
+ msfabricpysdkcore/item.py,sha256=S_E6WzcY_zIAAmtsLh5n_r6ziOqn4916cZtk49tGceA,11155
11
+ msfabricpysdkcore/job_instance.py,sha256=EYruSPpBUP3NXz7oVecyrDwwD7g2u25i9UhteC6HFyU,2828
12
+ msfabricpysdkcore/lakehouse.py,sha256=phXIuKdW0khJMJx_BK2X3TJRPXSJ_9B1QKFnt2k7WH4,4011
13
+ msfabricpysdkcore/long_running_operation.py,sha256=PvrVEuasD9lwdJZ6ElsNwBE1G8xW5uDQ8zXcKqpOpXc,3021
14
+ msfabricpysdkcore/onelakeshortcut.py,sha256=EYZfP-rl60HdCqJD1O1NXrQTgrYTIw-EWisF4hs4bTU,2102
15
+ msfabricpysdkcore/workspace.py,sha256=_kgBmxPrqHxYN8U0OyzzmLcW-ecgFitOkyD0xhzjGcI,21544
16
+ msfabricpysdkcore/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
+ msfabricpysdkcore/tests/test_admin_apis.py,sha256=M-WWQBgOG03hobCEH3dTu9VkJzyFLLN-yE9A9sdsi_8,2062
18
+ msfabricpysdkcore/tests/test_domains.py,sha256=GJX5WA_pEMYzeOGB-GAml0vnnj5AZqa7akSZB-yeBeA,4649
19
+ msfabricpysdkcore/tests/test_git.py,sha256=6OERflBSYfJbdPYuHeTEtUl2ZVqiJERVY0Z1APt94_g,2398
20
+ msfabricpysdkcore/tests/test_items_incl_lakehouse.py,sha256=Hf_E2SRwwxT0MOO_T1YbRs8j-NJ_CxKbGktJgIHuz-U,2941
21
+ msfabricpysdkcore/tests/test_jobs.py,sha256=G3edmNO9FpRgaVnG3RR_MTtxfSTLhp05-HBKWsRNJF8,1581
22
+ msfabricpysdkcore/tests/test_shortcuts.py,sha256=2Y4R-PfzpqaD3fEsZ7gMYGCnMPZSlgsw7V4jxZHewdU,2390
23
+ msfabricpysdkcore/tests/test_workspaces_capacities.py,sha256=2VHPvZ8GnpFStgUoZ-Al3kVVVimjkAs9YG47NsFl-zo,6563
24
+ msfabricpysdkcore-0.0.4.dist-info/LICENSE,sha256=1NrGuF-zOmzbwzk3iI6lsP9koyDeKO1B0-8OD_tTvOQ,1156
25
+ msfabricpysdkcore-0.0.4.dist-info/METADATA,sha256=BAoWOWMQxH9w71RiJ0PHTDFG11TaePLnkZbmJTHt_h0,16186
26
+ msfabricpysdkcore-0.0.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
27
+ msfabricpysdkcore-0.0.4.dist-info/top_level.txt,sha256=3iRonu6ptDGQN4Yl6G76XGM7xbFNsskiEHW-P2gMQGY,18
28
+ msfabricpysdkcore-0.0.4.dist-info/RECORD,,
@@ -1,13 +0,0 @@
1
- msfabricpysdkcore/__init__.py,sha256=HJeyM1aLgf9AvUGkU4Olky90YyySletA281VbSa0Q2c,36
2
- msfabricpysdkcore/auth.py,sha256=1t5prgSg2hK7vMutif2lxHOQk_qTo3152h3FMof3y_4,1929
3
- msfabricpysdkcore/client.py,sha256=NutMuFGVHUU8CMj2mSJT5Zw1A_vQ-PRJ_yH0nqwk9aI,12536
4
- msfabricpysdkcore/item.py,sha256=lQODVPxqMLKUwhit7KMDFu3GahW5o7wiWA6KHxMbqu0,10188
5
- msfabricpysdkcore/job_instance.py,sha256=Rjv2u1XXMPVew-9gGFQLrnhzXmYfzlO9SeUvA19DDTI,2759
6
- msfabricpysdkcore/long_running_operation.py,sha256=PvrVEuasD9lwdJZ6ElsNwBE1G8xW5uDQ8zXcKqpOpXc,3021
7
- msfabricpysdkcore/onelakeshortcut.py,sha256=20AZJ79v7FvgKLYbJi0BIaawi6qMjnhqUTIlniwnVBI,2033
8
- msfabricpysdkcore/workspace.py,sha256=mweliwZup5XKy5yx-BGIvhZboRrtvwFYzQ4JFEICv4E,19796
9
- msfabricpysdkcore-0.0.2.dist-info/LICENSE,sha256=1NrGuF-zOmzbwzk3iI6lsP9koyDeKO1B0-8OD_tTvOQ,1156
10
- msfabricpysdkcore-0.0.2.dist-info/METADATA,sha256=cxXnkCeEtm2_xdom8fgehH8SPk9Ot7k8TTxyIAo7cEc,11321
11
- msfabricpysdkcore-0.0.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
12
- msfabricpysdkcore-0.0.2.dist-info/top_level.txt,sha256=3iRonu6ptDGQN4Yl6G76XGM7xbFNsskiEHW-P2gMQGY,18
13
- msfabricpysdkcore-0.0.2.dist-info/RECORD,,