codeocean 0.10.0__tar.gz → 0.12.0__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.
- {codeocean-0.10.0 → codeocean-0.12.0}/CHANGELOG.md +8 -0
- {codeocean-0.10.0 → codeocean-0.12.0}/PKG-INFO +1 -1
- {codeocean-0.10.0 → codeocean-0.12.0}/pyproject.toml +1 -1
- {codeocean-0.10.0 → codeocean-0.12.0}/src/codeocean/capsule.py +21 -0
- {codeocean-0.10.0 → codeocean-0.12.0}/src/codeocean/client.py +1 -1
- {codeocean-0.10.0 → codeocean-0.12.0}/src/codeocean/computation.py +21 -2
- {codeocean-0.10.0 → codeocean-0.12.0}/src/codeocean/data_asset.py +21 -2
- {codeocean-0.10.0 → codeocean-0.12.0}/src/codeocean/folder.py +21 -0
- {codeocean-0.10.0 → codeocean-0.12.0}/.flake8 +0 -0
- {codeocean-0.10.0 → codeocean-0.12.0}/.gitignore +0 -0
- {codeocean-0.10.0 → codeocean-0.12.0}/LICENSE +0 -0
- {codeocean-0.10.0 → codeocean-0.12.0}/README.md +0 -0
- {codeocean-0.10.0 → codeocean-0.12.0}/RELEASE.md +0 -0
- {codeocean-0.10.0 → codeocean-0.12.0}/examples/create_data_asset.py +0 -0
- {codeocean-0.10.0 → codeocean-0.12.0}/examples/run_capsule.py +0 -0
- {codeocean-0.10.0 → codeocean-0.12.0}/examples/run_pipeline.py +0 -0
- {codeocean-0.10.0 → codeocean-0.12.0}/src/codeocean/__init__.py +0 -0
- {codeocean-0.10.0 → codeocean-0.12.0}/src/codeocean/components.py +0 -0
- {codeocean-0.10.0 → codeocean-0.12.0}/src/codeocean/custom_metadata.py +0 -0
- {codeocean-0.10.0 → codeocean-0.12.0}/src/codeocean/enum.py +0 -0
- {codeocean-0.10.0 → codeocean-0.12.0}/src/codeocean/error.py +0 -0
- {codeocean-0.10.0 → codeocean-0.12.0}/tests/__init__.py +0 -0
- {codeocean-0.10.0 → codeocean-0.12.0}/tests/test_client.py +0 -0
- {codeocean-0.10.0 → codeocean-0.12.0}/tests/test_error.py +0 -0
- {codeocean-0.10.0 → codeocean-0.12.0}/tests/test_package.py +0 -0
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
CHANGELOG
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## 0.12.0 (2025-10-20)
|
|
5
|
+
- [#61](https://github.com/codeocean/codeocean-sdk-python/pull/61) feat: add search_pipelines method
|
|
6
|
+
|
|
7
|
+
## 0.11.0 (2025-10-07)
|
|
8
|
+
- [#55](https://github.com/codeocean/codeocean-sdk-python/pull/55) feat: Code Ocean version 4.0 functionality
|
|
9
|
+
- **Minimum Code Ocean platform version updated to `4.0.0`.**
|
|
10
|
+
|
|
4
11
|
## 0.10.0 (2025-09-01)
|
|
5
12
|
- [#54](https://github.com/codeocean/codeocean-sdk-python/pull/54) feat: Code Ocean version 3.9 functionality
|
|
13
|
+
- **Minimum Code Ocean platform version updated to `3.9.0`.**
|
|
6
14
|
|
|
7
15
|
## 0.9.1 (2025-08-29)
|
|
8
16
|
- [#56](https://github.com/codeocean/codeocean-sdk-python/pull/56) fix: update query description in search APIs
|
|
@@ -547,3 +547,24 @@ class Capsules:
|
|
|
547
547
|
return
|
|
548
548
|
|
|
549
549
|
params["next_token"] = response.next_token
|
|
550
|
+
|
|
551
|
+
def search_pipelines(self, search_params: CapsuleSearchParams) -> CapsuleSearchResults:
|
|
552
|
+
"""Search for pipelines with filtering, sorting, and pagination
|
|
553
|
+
options."""
|
|
554
|
+
res = self.client.post("pipelines/search", json=search_params.to_dict())
|
|
555
|
+
|
|
556
|
+
return CapsuleSearchResults.from_dict(res.json())
|
|
557
|
+
|
|
558
|
+
def search_pipelines_iterator(self, search_params: CapsuleSearchParams) -> Iterator[Capsule]:
|
|
559
|
+
"""Iterate through all pipelines matching search criteria with automatic pagination."""
|
|
560
|
+
params = search_params.to_dict()
|
|
561
|
+
while True:
|
|
562
|
+
response = self.search_pipelines(search_params=CapsuleSearchParams(**params))
|
|
563
|
+
|
|
564
|
+
for result in response.results:
|
|
565
|
+
yield result
|
|
566
|
+
|
|
567
|
+
if not response.has_more:
|
|
568
|
+
return
|
|
569
|
+
|
|
570
|
+
params["next_token"] = response.next_token
|
|
@@ -37,7 +37,7 @@ class CodeOcean:
|
|
|
37
37
|
agent_id: Optional[str] = None
|
|
38
38
|
|
|
39
39
|
# Minimum server version required by this SDK
|
|
40
|
-
MIN_SERVER_VERSION = "
|
|
40
|
+
MIN_SERVER_VERSION = "4.0.0"
|
|
41
41
|
|
|
42
42
|
def __post_init__(self):
|
|
43
43
|
self.session = BaseUrlSession(base_url=f"{self.domain}/api/v1/")
|
|
@@ -5,9 +5,10 @@ from dataclasses_json import dataclass_json
|
|
|
5
5
|
from requests_toolbelt.sessions import BaseUrlSession
|
|
6
6
|
from typing import Optional
|
|
7
7
|
from time import sleep, time
|
|
8
|
+
from warnings import warn
|
|
8
9
|
|
|
9
10
|
from codeocean.enum import StrEnum
|
|
10
|
-
from codeocean.folder import Folder, DownloadFileURL
|
|
11
|
+
from codeocean.folder import FileURLs, Folder, DownloadFileURL
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
class ComputationState(StrEnum):
|
|
@@ -332,7 +333,16 @@ class Computations:
|
|
|
332
333
|
return Folder.from_dict(res.json())
|
|
333
334
|
|
|
334
335
|
def get_result_file_download_url(self, computation_id: str, path: str) -> DownloadFileURL:
|
|
335
|
-
"""Generate a download URL for a specific result file from a computation.
|
|
336
|
+
"""[DEPRECATED] Generate a download URL for a specific result file from a computation.
|
|
337
|
+
|
|
338
|
+
Deprecated: Use get_result_file_urls instead.
|
|
339
|
+
"""
|
|
340
|
+
warn(
|
|
341
|
+
"get_result_file_download_url is deprecated and will be removed in a future release. "
|
|
342
|
+
"Use get_result_file_urls instead.",
|
|
343
|
+
DeprecationWarning,
|
|
344
|
+
stacklevel=2,
|
|
345
|
+
)
|
|
336
346
|
res = self.client.get(
|
|
337
347
|
f"computations/{computation_id}/results/download_url",
|
|
338
348
|
params={"path": path},
|
|
@@ -340,6 +350,15 @@ class Computations:
|
|
|
340
350
|
|
|
341
351
|
return DownloadFileURL.from_dict(res.json())
|
|
342
352
|
|
|
353
|
+
def get_result_file_urls(self, computation_id: str, path: str) -> FileURLs:
|
|
354
|
+
"""Generate view and download URLs for a specific result file from a computation."""
|
|
355
|
+
res = self.client.get(
|
|
356
|
+
f"computations/{computation_id}/results/urls",
|
|
357
|
+
params={"path": path},
|
|
358
|
+
)
|
|
359
|
+
|
|
360
|
+
return FileURLs.from_dict(res.json())
|
|
361
|
+
|
|
343
362
|
def delete_computation(self, computation_id: str):
|
|
344
363
|
"""Delete a computation and stop it if currently running."""
|
|
345
364
|
self.client.delete(f"computations/{computation_id}")
|
|
@@ -5,11 +5,12 @@ from dataclasses import dataclass, field
|
|
|
5
5
|
from requests_toolbelt.sessions import BaseUrlSession
|
|
6
6
|
from time import sleep, time
|
|
7
7
|
from typing import Optional, Iterator
|
|
8
|
+
from warnings import warn
|
|
8
9
|
|
|
9
10
|
from codeocean.components import Ownership, SortOrder, SearchFilter, Permissions
|
|
10
11
|
from codeocean.computation import PipelineProcess, Param
|
|
11
12
|
from codeocean.enum import StrEnum
|
|
12
|
-
from codeocean.folder import Folder, DownloadFileURL
|
|
13
|
+
from codeocean.folder import FileURLs, Folder, DownloadFileURL
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
class DataAssetType(StrEnum):
|
|
@@ -849,7 +850,16 @@ class DataAssets:
|
|
|
849
850
|
return Folder.from_dict(res.json())
|
|
850
851
|
|
|
851
852
|
def get_data_asset_file_download_url(self, data_asset_id: str, path: str) -> DownloadFileURL:
|
|
852
|
-
"""Generate a download URL for a specific file from an internal data asset.
|
|
853
|
+
"""(Deprecated) Generate a download URL for a specific file from an internal data asset.
|
|
854
|
+
|
|
855
|
+
Deprecated: Use get_data_asset_file_urls instead.
|
|
856
|
+
"""
|
|
857
|
+
warn(
|
|
858
|
+
"get_data_asset_file_download_url is deprecated and will be removed in a future release. "
|
|
859
|
+
"Use get_data_asset_file_urls instead.",
|
|
860
|
+
DeprecationWarning,
|
|
861
|
+
stacklevel=2,
|
|
862
|
+
)
|
|
853
863
|
res = self.client.get(
|
|
854
864
|
f"data_assets/{data_asset_id}/files/download_url",
|
|
855
865
|
params={"path": path},
|
|
@@ -857,6 +867,15 @@ class DataAssets:
|
|
|
857
867
|
|
|
858
868
|
return DownloadFileURL.from_dict(res.json())
|
|
859
869
|
|
|
870
|
+
def get_data_asset_file_urls(self, data_asset_id: str, path: str) -> FileURLs:
|
|
871
|
+
"""Generate view and download URLs for a specific file from an internal data asset."""
|
|
872
|
+
res = self.client.get(
|
|
873
|
+
f"data_assets/{data_asset_id}/files/urls",
|
|
874
|
+
params={"path": path},
|
|
875
|
+
)
|
|
876
|
+
|
|
877
|
+
return FileURLs.from_dict(res.json())
|
|
878
|
+
|
|
860
879
|
def transfer_data_asset(self, data_asset_id: str, transfer_params: TransferDataParams):
|
|
861
880
|
"""
|
|
862
881
|
Transfer a data asset's files to a different S3 storage location (Admin only).
|
|
@@ -3,6 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
from dataclasses_json import dataclass_json
|
|
4
4
|
from dataclasses import dataclass, field
|
|
5
5
|
from typing import Optional
|
|
6
|
+
from warnings import warn
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
@dataclass_json
|
|
@@ -53,3 +54,23 @@ class DownloadFileURL:
|
|
|
53
54
|
url: str = field(
|
|
54
55
|
metadata={"description": "Pre-signed URL for downloading the specified file"}
|
|
55
56
|
)
|
|
57
|
+
|
|
58
|
+
def __post_init__(self):
|
|
59
|
+
warn(
|
|
60
|
+
"DownloadFileURL is deprecated and will be removed in a future release.",
|
|
61
|
+
DeprecationWarning,
|
|
62
|
+
stacklevel=2
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
@dataclass_json
|
|
67
|
+
@dataclass(frozen=True)
|
|
68
|
+
class FileURLs:
|
|
69
|
+
"""Represents a collection of file download URLs."""
|
|
70
|
+
|
|
71
|
+
download_url: str = field(
|
|
72
|
+
metadata={"description": "Signed URL for downloading the file"}
|
|
73
|
+
)
|
|
74
|
+
view_url: str = field(
|
|
75
|
+
metadata={"description": "Signed URL for viewing the file in the browser"}
|
|
76
|
+
)
|
|
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
|