lightning-sdk 2025.12.1__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.
- lightning_sdk/__version__.py +1 -1
- lightning_sdk/api/studio_api.py +29 -0
- lightning_sdk/studio.py +0 -25
- {lightning_sdk-2025.12.1.dist-info → lightning_sdk-2025.12.2.dist-info}/METADATA +1 -1
- {lightning_sdk-2025.12.1.dist-info → lightning_sdk-2025.12.2.dist-info}/RECORD +9 -9
- {lightning_sdk-2025.12.1.dist-info → lightning_sdk-2025.12.2.dist-info}/LICENSE +0 -0
- {lightning_sdk-2025.12.1.dist-info → lightning_sdk-2025.12.2.dist-info}/WHEEL +0 -0
- {lightning_sdk-2025.12.1.dist-info → lightning_sdk-2025.12.2.dist-info}/entry_points.txt +0 -0
- {lightning_sdk-2025.12.1.dist-info → lightning_sdk-2025.12.2.dist-info}/top_level.txt +0 -0
lightning_sdk/__version__.py
CHANGED
lightning_sdk/api/studio_api.py
CHANGED
|
@@ -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
|
|
@@ -659,6 +660,34 @@ class StudioApi:
|
|
|
659
660
|
)
|
|
660
661
|
return r.json()
|
|
661
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
|
+
|
|
662
691
|
def upload_file(
|
|
663
692
|
self,
|
|
664
693
|
studio_id: str,
|
lightning_sdk/studio.py
CHANGED
|
@@ -570,31 +570,6 @@ class Studio(metaclass=TrackCallsMeta):
|
|
|
570
570
|
raise RuntimeError(output)
|
|
571
571
|
return output
|
|
572
572
|
|
|
573
|
-
def get_path_info(self, path: str = "") -> dict:
|
|
574
|
-
path = path.strip("/")
|
|
575
|
-
|
|
576
|
-
if "/" in path:
|
|
577
|
-
parent_path = path.rsplit("/", 1)[0]
|
|
578
|
-
target_name = path.rsplit("/", 1)[1]
|
|
579
|
-
else:
|
|
580
|
-
parent_path = ""
|
|
581
|
-
target_name = path
|
|
582
|
-
|
|
583
|
-
tree = self._studio_api.get_tree(self._studio.id, self._teamspace.id, path=parent_path)
|
|
584
|
-
tree_items = tree.get("tree", [])
|
|
585
|
-
for item in tree_items:
|
|
586
|
-
item_name = item.get("path", "")
|
|
587
|
-
if item_name == target_name:
|
|
588
|
-
item_type = item.get("type")
|
|
589
|
-
# if type == "blob" it's a file, if "tree" it's a directory
|
|
590
|
-
return {
|
|
591
|
-
"exists": True,
|
|
592
|
-
"type": "file" if item_type == "blob" else "directory",
|
|
593
|
-
"size": item.get("size", 0) if item_type == "blob" else None,
|
|
594
|
-
}
|
|
595
|
-
warnings.warn(f"If '{path}' is a directory, it may be empty and thus not detected.")
|
|
596
|
-
return {"exists": False, "type": None, "size": None}
|
|
597
|
-
|
|
598
573
|
def upload_file(self, file_path: str, remote_path: Optional[str] = None, progress_bar: bool = True) -> None:
|
|
599
574
|
"""Uploads a given file to a remote path on the Studio."""
|
|
600
575
|
if remote_path is None:
|
|
@@ -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=
|
|
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
|
|
@@ -17,7 +17,7 @@ lightning_sdk/plugin.py,sha256=yaQrIx2Tt18R0CoarJQAtB_AwaVa436f-eC5rb9yWe4,15579
|
|
|
17
17
|
lightning_sdk/sandbox.py,sha256=_NvnWotEXW2rBiVFZZ4krKXxVjuAqfNh04qELSM0-Pg,5786
|
|
18
18
|
lightning_sdk/serve.py,sha256=XbllHwmOAOHjQJ0AQukwYe3OtspEwhmf5-_HXhL-mpc,11908
|
|
19
19
|
lightning_sdk/status.py,sha256=lLGAuSvXBoXQFEEsEYwdCi0RcSNatUn5OPjJVjDtoM0,386
|
|
20
|
-
lightning_sdk/studio.py,sha256=
|
|
20
|
+
lightning_sdk/studio.py,sha256=Yx8vw_-SPmr0UzWQ7Kq_IXDFtuk-j0UhM95-Fyaexjc,37609
|
|
21
21
|
lightning_sdk/teamspace.py,sha256=pskDJWe3OGKFeXCKr-QZbzgor2AOQwdzgxqlS8Ahj_o,27558
|
|
22
22
|
lightning_sdk/user.py,sha256=TSYh38rxoi7qKOfrK2JYh_Nknya2Kbz2ngDIY85fFOY,1778
|
|
23
23
|
lightning_sdk/api/__init__.py,sha256=8boDRZ0LMl7G_IbpqHS2q3efeX_Y897_gsJ3iBF58M4,538
|
|
@@ -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=
|
|
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
|
|
@@ -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.12.
|
|
1285
|
-
lightning_sdk-2025.12.
|
|
1286
|
-
lightning_sdk-2025.12.
|
|
1287
|
-
lightning_sdk-2025.12.
|
|
1288
|
-
lightning_sdk-2025.12.
|
|
1289
|
-
lightning_sdk-2025.12.
|
|
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,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|