lightning-sdk 2025.11.24__py3-none-any.whl → 2025.12.2__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,3 +1,3 @@
1
1
  """Version information for lightning_sdk."""
2
2
 
3
- __version__ = "2025.11.24"
3
+ __version__ = "2025.12.02"
@@ -1,6 +1,7 @@
1
1
  import json
2
2
  import os
3
3
  import time
4
+ import warnings
4
5
  from pathlib import Path
5
6
  from threading import Event, Thread
6
7
  from typing import Any, Dict, Generator, List, Mapping, Optional, Tuple, Union
@@ -645,6 +646,48 @@ class StudioApi:
645
646
  self.stop_keeping_alive(teamspace_id=teamspace_id, studio_id=studio_id)
646
647
  self._client.cloud_space_service_delete_cloud_space(project_id=teamspace_id, id=studio_id)
647
648
 
649
+ def get_tree(self, studio_id: str, teamspace_id: str, path: str) -> None:
650
+ auth = Auth()
651
+ auth.authenticate()
652
+ token = self._client.auth_service_login(V1LoginRequest(auth.api_key)).token
653
+
654
+ query_params = {
655
+ "token": token,
656
+ }
657
+ r = requests.get(
658
+ f"{self._client.api_client.configuration.host}/v1/projects/{teamspace_id}/artifacts/cloudspaces/{studio_id}/trees/{path}",
659
+ params=query_params,
660
+ )
661
+ return r.json()
662
+
663
+ def get_path_info(self, studio_id: str, teamspace_id: str, path: str = "") -> dict:
664
+ path = path.strip("/")
665
+
666
+ if "/" in path:
667
+ parent_path = path.rsplit("/", 1)[0]
668
+ target_name = path.rsplit("/", 1)[1]
669
+ else:
670
+ if path == "":
671
+ # root directory
672
+ return {"exists": True, "type": "directory", "size": None}
673
+ parent_path = ""
674
+ target_name = path
675
+
676
+ tree = self.get_tree(studio_id, teamspace_id, path=parent_path)
677
+ tree_items = tree.get("tree", [])
678
+ for item in tree_items:
679
+ item_name = item.get("path", "")
680
+ if item_name == target_name:
681
+ item_type = item.get("type")
682
+ # if type == "blob" it's a file, if "tree" it's a directory
683
+ return {
684
+ "exists": True,
685
+ "type": "file" if item_type == "blob" else "directory",
686
+ "size": item.get("size", 0) if item_type == "blob" else None,
687
+ }
688
+ warnings.warn(f"If '{path}' is a directory, it may be empty and thus not detected.")
689
+ return {"exists": False, "type": None, "size": None}
690
+
648
691
  def upload_file(
649
692
  self,
650
693
  studio_id: str,
@@ -106,7 +106,7 @@ def cp_upload(
106
106
  )
107
107
  console.print(f"Uploading to {selected_studio.teamspace.name}/{selected_studio.name}")
108
108
 
109
- selected_studio.upload_file(local_file_path, studio_file_path)
109
+ selected_studio.upload_file(local_file_path, studio_path_result["destination"])
110
110
 
111
111
  studio_url = (
112
112
  _get_cloud_url().replace(":443", "")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lightning_sdk
3
- Version: 2025.11.24
3
+ Version: 2025.12.2
4
4
  Summary: SDK to develop using Lightning AI Studios
5
5
  Author-email: Lightning-AI <justus@lightning.ai>
6
6
  License: MIT License
@@ -1,6 +1,6 @@
1
1
  docs/source/conf.py,sha256=r8yX20eC-4mHhMTd0SbQb5TlSWHhO6wnJ0VJ_FBFpag,13249
2
2
  lightning_sdk/__init__.py,sha256=ym1mOWljHxiO4oijOrmtcjf-eIcwYJVFXkDvLduL4FA,1368
3
- lightning_sdk/__version__.py,sha256=V3hR8FYpXxOoX_m7TQa6fGoMH4tG3vyjfF5SeH33ng8,73
3
+ lightning_sdk/__version__.py,sha256=mY7vyA2HBdHarQMNRbuD6EwG9ApvXSIPOttfDRj1rfk,73
4
4
  lightning_sdk/agents.py,sha256=Uqsdu4PgswhpeXZzDSbp3hu30MMOhSlCnp8D56MaS_c,1658
5
5
  lightning_sdk/ai_hub.py,sha256=QzCfmX0h2CLn7r0DQyjWg6RnNw26Ey6akiP2Wffl9Ls,7006
6
6
  lightning_sdk/base_studio.py,sha256=yMvZ1dDq_avW3iu98CLEo9W9UL54mx4C6FC43IKLWAE,4691
@@ -34,7 +34,7 @@ lightning_sdk/api/llm_api.py,sha256=8ouowlX-Ld0hRvueIS6fQqaEJLQMYskvhKV5-Z_A6gE,
34
34
  lightning_sdk/api/mmt_api.py,sha256=yI_iFtxGd1g0pW82xQWY80jSYVmF_xU-eT1-LgUA-KI,10815
35
35
  lightning_sdk/api/org_api.py,sha256=Ze3z_ATVrukobujV5YdC42DKj45Vuwl7X52q_Vr-o3U,803
36
36
  lightning_sdk/api/pipeline_api.py,sha256=rJYp_FN7uUjC5xbc6K67l2eRSmVuOkijd5i8Nm5BF7I,4621
37
- lightning_sdk/api/studio_api.py,sha256=698aDT2D-lk2KrCXY4xK0RoscbmePbaM2bUAFvRnsDM,40776
37
+ lightning_sdk/api/studio_api.py,sha256=5ga510pDvxnEjc0zCLzp9Yo2GmKnA5Ppm0-Ub_YNUXs,42494
38
38
  lightning_sdk/api/teamspace_api.py,sha256=wuwW4YbhloFqI9rS_5mbgsS6Dk3zYONLv9M6OoqyDg8,19980
39
39
  lightning_sdk/api/user_api.py,sha256=o9gZmtvqNfj4kdSpo2fyyRuFAP7bM5w7mx0Oj9__Ads,4702
40
40
  lightning_sdk/api/utils.py,sha256=mB8ZPjxj8jjXMWRBtG-g0ZvR7NayZnGhMtEZfQMHtqA,29734
@@ -84,7 +84,7 @@ lightning_sdk/cli/license/set.py,sha256=uGjFgq-3jkMF0IstMIIRjKn8GDzg9TIe1OZcRkDT
84
84
  lightning_sdk/cli/mmt/__init__.py,sha256=CLgr-ZHHLS6Db_JGqpxbn4G2pYrKi4Qn-uhi8e0kFNc,145
85
85
  lightning_sdk/cli/studio/__init__.py,sha256=wREPAmPJdN4b51r6RRD1o4aE212KN7xI88Z0O6HTzEU,1022
86
86
  lightning_sdk/cli/studio/connect.py,sha256=RLi5VumsVlVDlyiGbST7lDuHAntOj_-99KsNr8J3knE,5057
87
- lightning_sdk/cli/studio/cp.py,sha256=u1GM58i4YO70GqbgnNAIkG-HnIOW5b5y1Mby3SsQKRk,4748
87
+ lightning_sdk/cli/studio/cp.py,sha256=qQn803KmK6AR4dIjLgLuOKU8VbC8_FW7eMxAB_lwgno,4765
88
88
  lightning_sdk/cli/studio/create.py,sha256=eVkuP1qg1aQSe2jyDgbIg-si5xPl8CwDIPcyvkUEFnQ,3179
89
89
  lightning_sdk/cli/studio/delete.py,sha256=Gi1KLCrSgjTiyoQe9NRvF4ZpsNyeM07KHnBxfdJg2FE,1483
90
90
  lightning_sdk/cli/studio/list.py,sha256=ieLiHRIfAb7E5e_r48BeTC03ib8RY6maeF7nkmrqaek,3301
@@ -1281,9 +1281,9 @@ lightning_sdk/utils/logging.py,sha256=WPyOx7KAn8OpRKqoDDlB7MkORtLDryJsj1WVXLYNqy
1281
1281
  lightning_sdk/utils/names.py,sha256=1EuXbIh7wldkDp1FG10oz9vIOyWrpGWeFFVy-DQBgzA,18162
1282
1282
  lightning_sdk/utils/progress.py,sha256=bLWw39fzq29PMWoFXaPIVfoS3Ug245950oWOFJ2ZaiU,12596
1283
1283
  lightning_sdk/utils/resolve.py,sha256=ukC-Zn35gNZV-fQ-ZyUgZkRPFb8nwsFh_aN7YcJ0sl8,10613
1284
- lightning_sdk-2025.11.24.dist-info/LICENSE,sha256=uFIuZwj5z-4TeF2UuacPZ1o17HkvKObT8fY50qN84sg,1064
1285
- lightning_sdk-2025.11.24.dist-info/METADATA,sha256=1ENc8Lq9RdRTspHlpRLISDrX8Zx8rR84T2rw7V0ubig,4153
1286
- lightning_sdk-2025.11.24.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
1287
- lightning_sdk-2025.11.24.dist-info/entry_points.txt,sha256=OoZa4Fc8NMs6GSN0cdA1J8e6couzAcL82CbM1yo4f_M,122
1288
- lightning_sdk-2025.11.24.dist-info/top_level.txt,sha256=ps8doKILFXmN7F1mHncShmnQoTxKBRPIcchC8TpoBw4,19
1289
- lightning_sdk-2025.11.24.dist-info/RECORD,,
1284
+ lightning_sdk-2025.12.2.dist-info/LICENSE,sha256=uFIuZwj5z-4TeF2UuacPZ1o17HkvKObT8fY50qN84sg,1064
1285
+ lightning_sdk-2025.12.2.dist-info/METADATA,sha256=x8WV1oEbZWPehEeHjIxUzdQI0mmKcXMG6-JXsbxRDwE,4152
1286
+ lightning_sdk-2025.12.2.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
1287
+ lightning_sdk-2025.12.2.dist-info/entry_points.txt,sha256=OoZa4Fc8NMs6GSN0cdA1J8e6couzAcL82CbM1yo4f_M,122
1288
+ lightning_sdk-2025.12.2.dist-info/top_level.txt,sha256=ps8doKILFXmN7F1mHncShmnQoTxKBRPIcchC8TpoBw4,19
1289
+ lightning_sdk-2025.12.2.dist-info/RECORD,,