codeocean 0.3.0__tar.gz → 0.3.2__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.
@@ -1,6 +1,14 @@
1
1
  CHANGELOG
2
2
  =========
3
3
 
4
+ ## 0.3.2 (2025-02-21)
5
+ - [#33](https://github.com/codeocean/codeocean-sdk-python/pull/33) feat: add iterator function for search capsule API
6
+
7
+ ## 0.3.1 (2025-01-30)
8
+ - [#31](https://github.com/codeocean/codeocean-sdk-python/pull/31) fix: set fields as optional fields according to openapi spec
9
+ - [#30](https://github.com/codeocean/codeocean-sdk-python/pull/30) fix: make all DataAssetUpdateParams fields optional
10
+ - [#29](https://github.com/codeocean/codeocean-sdk-python/pull/29) Add SDK compatibility details
11
+
4
12
  ## 0.3.0 (2025-01-07)
5
13
 
6
14
  - [#25](https://github.com/codeocean/codeocean-sdk-python/pull/25) feat: Add support for Python 3.13
@@ -9,6 +17,7 @@ CHANGELOG
9
17
  - [#21](https://github.com/codeocean/codeocean-sdk-python/pull/21) feat: Code Ocean Version 3.1 updates
10
18
  - [#18](https://github.com/codeocean/codeocean-sdk-python/pull/18) feat: Combined data asset
11
19
  - [#16](https://github.com/codeocean/codeocean-sdk-python/pull/16) fix: revert default number of retries to 0
20
+ - **Minimum Code Ocean platform version updated to `3.1.0`.**
12
21
 
13
22
  ## 0.2.0 (2024-10-21)
14
23
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codeocean
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: Code Ocean Python SDK
5
5
  Project-URL: Homepage, https://github.com/codeocean/codeocean-sdk-python
6
6
  Project-URL: Issues, https://github.com/codeocean/codeocean-sdk-python/issues
@@ -41,3 +41,10 @@ For development, install from source with:
41
41
  ```sh
42
42
  pip install -e .[dev] -U
43
43
  ```
44
+
45
+ ## Code Ocean Python SDK Version Compatibility
46
+
47
+ Each release of this Code Ocean Python SDK is tested and verified against a specific minimum version of the Code Ocean platform API.
48
+ Generally, this minimum version is the latest Code Ocean version at the time of the SDK’s release.
49
+ We recommend ensuring your SDK dependency is pinned to a version compatible with your Code Ocean deployment.
50
+ For details on when the minimum Code Ocean platform version changes, see the [CHANGELOG](CHANGELOG.md).
@@ -18,3 +18,10 @@ For development, install from source with:
18
18
  ```sh
19
19
  pip install -e .[dev] -U
20
20
  ```
21
+
22
+ ## Code Ocean Python SDK Version Compatibility
23
+
24
+ Each release of this Code Ocean Python SDK is tested and verified against a specific minimum version of the Code Ocean platform API.
25
+ Generally, this minimum version is the latest Code Ocean version at the time of the SDK’s release.
26
+ We recommend ensuring your SDK dependency is pinned to a version compatible with your Code Ocean deployment.
27
+ For details on when the minimum Code Ocean platform version changes, see the [CHANGELOG](CHANGELOG.md).
@@ -0,0 +1,24 @@
1
+ # Version Release Process
2
+
3
+ 1. Open a PR with the following changes:
4
+ 1. Bump the version in [pyproject.toml](pyproject.toml).
5
+ 1. Update the [CHANGELOG.md](CHANGELOG.md).
6
+ 1. Commit the updates with the message `Bump version to X.Y.Z`.
7
+ 1. Merge the PR.
8
+ 1. Locally, sync your clone with GitHub:
9
+ ```
10
+ git fetch origin
11
+ git checkout main
12
+ git reset --hard origin/main
13
+ ```
14
+ 1. Tag the release:
15
+ ```
16
+ git tag vX.Y.Z -m "vX.Y.Z"
17
+ ```
18
+ 1. Push changes:
19
+ ```
20
+ git push origin vX.Y.Z
21
+ ```
22
+
23
+ This will trigger a workflow on CircleCI that will generate a GitHub release
24
+ and publish the new version to PyPI.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "codeocean"
7
- version = "0.3.0"
7
+ version = "0.3.2"
8
8
  authors = [
9
9
  { name="Code Ocean", email="dev@codeocean.com" },
10
10
  ]
@@ -2,7 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  from dataclasses import dataclass
4
4
  from dataclasses_json import dataclass_json
5
- from typing import Optional
5
+ from typing import Optional, Iterator
6
6
  from requests_toolbelt.sessions import BaseUrlSession
7
7
 
8
8
  from codeocean.components import Ownership, SortOrder, SearchFilter
@@ -113,3 +113,18 @@ class Capsules:
113
113
  res = self.client.post("capsules/search", json=search_params.to_dict())
114
114
 
115
115
  return CapsuleSearchResults.from_dict(res.json())
116
+
117
+ def search_capsules_iterator(self, search_params: CapsuleSearchParams) -> Iterator[Capsules]:
118
+ params = search_params.to_dict()
119
+ while True:
120
+ response = self.search_capsules(
121
+ search_params=CapsuleSearchParams(**params)
122
+ )
123
+
124
+ for result in response.results:
125
+ yield result
126
+
127
+ if not response.has_more:
128
+ return
129
+
130
+ params["next_token"] = response.next_token
@@ -53,8 +53,8 @@ class SourceBucket:
53
53
  @dataclass_json
54
54
  @dataclass(frozen=True)
55
55
  class AppParameter:
56
- name: str
57
- value: str
56
+ name: Optional[str] = None
57
+ value: Optional[str] = None
58
58
 
59
59
 
60
60
  @dataclass_json
@@ -97,10 +97,10 @@ class DataAsset:
97
97
  @dataclass_json
98
98
  @dataclass(frozen=True)
99
99
  class DataAssetUpdateParams:
100
- name: str
101
- description: str
102
- tags: list[str]
103
- mount: str
100
+ name: Optional[str] = None
101
+ description: Optional[str] = None
102
+ tags: Optional[list[str]] = None
103
+ mount: Optional[str] = None
104
104
  custom_metadata: Optional[dict] = None
105
105
 
106
106
 
@@ -175,11 +175,11 @@ class DataAssetAttachParams:
175
175
  @dataclass(frozen=True)
176
176
  class DataAssetAttachResults:
177
177
  id: str
178
- mount: str
179
- mount_state: str
180
- job_id: str
181
- external: bool
182
- ready: bool
178
+ mount_state: Optional[str] = None
179
+ job_id: Optional[str] = None
180
+ external: Optional[bool] = None
181
+ ready: Optional[bool] = None
182
+ mount: Optional[str] = None
183
183
 
184
184
 
185
185
  class DataAssetSortBy(StrEnum):
File without changes
File without changes
File without changes
File without changes