codeset 0.1.0a14__py3-none-any.whl → 0.1.0a16__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.

Potentially problematic release.


This version of codeset might be problematic. Click here for more details.

codeset/_client.py CHANGED
@@ -22,7 +22,7 @@ from ._types import (
22
22
  )
23
23
  from ._utils import is_given, get_async_library
24
24
  from ._version import __version__
25
- from .resources import health, samples
25
+ from .resources import health, samples, datasets
26
26
  from ._streaming import Stream as Stream, AsyncStream as AsyncStream
27
27
  from ._exceptions import APIStatusError
28
28
  from ._base_client import (
@@ -38,6 +38,7 @@ __all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Codeset",
38
38
  class Codeset(SyncAPIClient):
39
39
  health: health.HealthResource
40
40
  samples: samples.SamplesResource
41
+ datasets: datasets.DatasetsResource
41
42
  sessions: sessions.SessionsResource
42
43
  with_raw_response: CodesetWithRawResponse
43
44
  with_streaming_response: CodesetWithStreamedResponse
@@ -94,6 +95,7 @@ class Codeset(SyncAPIClient):
94
95
 
95
96
  self.health = health.HealthResource(self)
96
97
  self.samples = samples.SamplesResource(self)
98
+ self.datasets = datasets.DatasetsResource(self)
97
99
  self.sessions = sessions.SessionsResource(self)
98
100
  self.with_raw_response = CodesetWithRawResponse(self)
99
101
  self.with_streaming_response = CodesetWithStreamedResponse(self)
@@ -219,6 +221,7 @@ class Codeset(SyncAPIClient):
219
221
  class AsyncCodeset(AsyncAPIClient):
220
222
  health: health.AsyncHealthResource
221
223
  samples: samples.AsyncSamplesResource
224
+ datasets: datasets.AsyncDatasetsResource
222
225
  sessions: sessions.AsyncSessionsResource
223
226
  with_raw_response: AsyncCodesetWithRawResponse
224
227
  with_streaming_response: AsyncCodesetWithStreamedResponse
@@ -275,6 +278,7 @@ class AsyncCodeset(AsyncAPIClient):
275
278
 
276
279
  self.health = health.AsyncHealthResource(self)
277
280
  self.samples = samples.AsyncSamplesResource(self)
281
+ self.datasets = datasets.AsyncDatasetsResource(self)
278
282
  self.sessions = sessions.AsyncSessionsResource(self)
279
283
  self.with_raw_response = AsyncCodesetWithRawResponse(self)
280
284
  self.with_streaming_response = AsyncCodesetWithStreamedResponse(self)
@@ -401,6 +405,7 @@ class CodesetWithRawResponse:
401
405
  def __init__(self, client: Codeset) -> None:
402
406
  self.health = health.HealthResourceWithRawResponse(client.health)
403
407
  self.samples = samples.SamplesResourceWithRawResponse(client.samples)
408
+ self.datasets = datasets.DatasetsResourceWithRawResponse(client.datasets)
404
409
  self.sessions = sessions.SessionsResourceWithRawResponse(client.sessions)
405
410
 
406
411
 
@@ -408,6 +413,7 @@ class AsyncCodesetWithRawResponse:
408
413
  def __init__(self, client: AsyncCodeset) -> None:
409
414
  self.health = health.AsyncHealthResourceWithRawResponse(client.health)
410
415
  self.samples = samples.AsyncSamplesResourceWithRawResponse(client.samples)
416
+ self.datasets = datasets.AsyncDatasetsResourceWithRawResponse(client.datasets)
411
417
  self.sessions = sessions.AsyncSessionsResourceWithRawResponse(client.sessions)
412
418
 
413
419
 
@@ -415,6 +421,7 @@ class CodesetWithStreamedResponse:
415
421
  def __init__(self, client: Codeset) -> None:
416
422
  self.health = health.HealthResourceWithStreamingResponse(client.health)
417
423
  self.samples = samples.SamplesResourceWithStreamingResponse(client.samples)
424
+ self.datasets = datasets.DatasetsResourceWithStreamingResponse(client.datasets)
418
425
  self.sessions = sessions.SessionsResourceWithStreamingResponse(client.sessions)
419
426
 
420
427
 
@@ -422,6 +429,7 @@ class AsyncCodesetWithStreamedResponse:
422
429
  def __init__(self, client: AsyncCodeset) -> None:
423
430
  self.health = health.AsyncHealthResourceWithStreamingResponse(client.health)
424
431
  self.samples = samples.AsyncSamplesResourceWithStreamingResponse(client.samples)
432
+ self.datasets = datasets.AsyncDatasetsResourceWithStreamingResponse(client.datasets)
425
433
  self.sessions = sessions.AsyncSessionsResourceWithStreamingResponse(client.sessions)
426
434
 
427
435
 
codeset/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "codeset"
4
- __version__ = "0.1.0-alpha.14" # x-release-please-version
4
+ __version__ = "0.1.0-alpha.16" # x-release-please-version
@@ -16,6 +16,14 @@ from .samples import (
16
16
  SamplesResourceWithStreamingResponse,
17
17
  AsyncSamplesResourceWithStreamingResponse,
18
18
  )
19
+ from .datasets import (
20
+ DatasetsResource,
21
+ AsyncDatasetsResource,
22
+ DatasetsResourceWithRawResponse,
23
+ AsyncDatasetsResourceWithRawResponse,
24
+ DatasetsResourceWithStreamingResponse,
25
+ AsyncDatasetsResourceWithStreamingResponse,
26
+ )
19
27
  from .sessions import (
20
28
  SessionsResource,
21
29
  AsyncSessionsResource,
@@ -38,6 +46,12 @@ __all__ = [
38
46
  "AsyncSamplesResourceWithRawResponse",
39
47
  "SamplesResourceWithStreamingResponse",
40
48
  "AsyncSamplesResourceWithStreamingResponse",
49
+ "DatasetsResource",
50
+ "AsyncDatasetsResource",
51
+ "DatasetsResourceWithRawResponse",
52
+ "AsyncDatasetsResourceWithRawResponse",
53
+ "DatasetsResourceWithStreamingResponse",
54
+ "AsyncDatasetsResourceWithStreamingResponse",
41
55
  "SessionsResource",
42
56
  "AsyncSessionsResource",
43
57
  "SessionsResourceWithRawResponse",
@@ -0,0 +1,135 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ import httpx
6
+
7
+ from .._types import Body, Query, Headers, NotGiven, not_given
8
+ from .._compat import cached_property
9
+ from .._resource import SyncAPIResource, AsyncAPIResource
10
+ from .._response import (
11
+ to_raw_response_wrapper,
12
+ to_streamed_response_wrapper,
13
+ async_to_raw_response_wrapper,
14
+ async_to_streamed_response_wrapper,
15
+ )
16
+ from .._base_client import make_request_options
17
+ from ..types.dataset_list_response import DatasetListResponse
18
+
19
+ __all__ = ["DatasetsResource", "AsyncDatasetsResource"]
20
+
21
+
22
+ class DatasetsResource(SyncAPIResource):
23
+ @cached_property
24
+ def with_raw_response(self) -> DatasetsResourceWithRawResponse:
25
+ """
26
+ This property can be used as a prefix for any HTTP method call to return
27
+ the raw response object instead of the parsed content.
28
+
29
+ For more information, see https://www.github.com/codeset-ai/codeset-sdk#accessing-raw-response-data-eg-headers
30
+ """
31
+ return DatasetsResourceWithRawResponse(self)
32
+
33
+ @cached_property
34
+ def with_streaming_response(self) -> DatasetsResourceWithStreamingResponse:
35
+ """
36
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
37
+
38
+ For more information, see https://www.github.com/codeset-ai/codeset-sdk#with_streaming_response
39
+ """
40
+ return DatasetsResourceWithStreamingResponse(self)
41
+
42
+ def list(
43
+ self,
44
+ *,
45
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
46
+ # The extra values given here take precedence over values defined on the client or passed to this method.
47
+ extra_headers: Headers | None = None,
48
+ extra_query: Query | None = None,
49
+ extra_body: Body | None = None,
50
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
51
+ ) -> DatasetListResponse:
52
+ """List available datasets"""
53
+ return self._get(
54
+ "/datasets",
55
+ options=make_request_options(
56
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
57
+ ),
58
+ cast_to=DatasetListResponse,
59
+ )
60
+
61
+
62
+ class AsyncDatasetsResource(AsyncAPIResource):
63
+ @cached_property
64
+ def with_raw_response(self) -> AsyncDatasetsResourceWithRawResponse:
65
+ """
66
+ This property can be used as a prefix for any HTTP method call to return
67
+ the raw response object instead of the parsed content.
68
+
69
+ For more information, see https://www.github.com/codeset-ai/codeset-sdk#accessing-raw-response-data-eg-headers
70
+ """
71
+ return AsyncDatasetsResourceWithRawResponse(self)
72
+
73
+ @cached_property
74
+ def with_streaming_response(self) -> AsyncDatasetsResourceWithStreamingResponse:
75
+ """
76
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
77
+
78
+ For more information, see https://www.github.com/codeset-ai/codeset-sdk#with_streaming_response
79
+ """
80
+ return AsyncDatasetsResourceWithStreamingResponse(self)
81
+
82
+ async def list(
83
+ self,
84
+ *,
85
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
86
+ # The extra values given here take precedence over values defined on the client or passed to this method.
87
+ extra_headers: Headers | None = None,
88
+ extra_query: Query | None = None,
89
+ extra_body: Body | None = None,
90
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
91
+ ) -> DatasetListResponse:
92
+ """List available datasets"""
93
+ return await self._get(
94
+ "/datasets",
95
+ options=make_request_options(
96
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
97
+ ),
98
+ cast_to=DatasetListResponse,
99
+ )
100
+
101
+
102
+ class DatasetsResourceWithRawResponse:
103
+ def __init__(self, datasets: DatasetsResource) -> None:
104
+ self._datasets = datasets
105
+
106
+ self.list = to_raw_response_wrapper(
107
+ datasets.list,
108
+ )
109
+
110
+
111
+ class AsyncDatasetsResourceWithRawResponse:
112
+ def __init__(self, datasets: AsyncDatasetsResource) -> None:
113
+ self._datasets = datasets
114
+
115
+ self.list = async_to_raw_response_wrapper(
116
+ datasets.list,
117
+ )
118
+
119
+
120
+ class DatasetsResourceWithStreamingResponse:
121
+ def __init__(self, datasets: DatasetsResource) -> None:
122
+ self._datasets = datasets
123
+
124
+ self.list = to_streamed_response_wrapper(
125
+ datasets.list,
126
+ )
127
+
128
+
129
+ class AsyncDatasetsResourceWithStreamingResponse:
130
+ def __init__(self, datasets: AsyncDatasetsResource) -> None:
131
+ self._datasets = datasets
132
+
133
+ self.list = async_to_streamed_response_wrapper(
134
+ datasets.list,
135
+ )
codeset/types/__init__.py CHANGED
@@ -8,6 +8,7 @@ from .container_info import ContainerInfo as ContainerInfo
8
8
  from .session_status import SessionStatus as SessionStatus
9
9
  from .sample_list_params import SampleListParams as SampleListParams
10
10
  from .sample_list_response import SampleListResponse as SampleListResponse
11
+ from .dataset_list_response import DatasetListResponse as DatasetListResponse
11
12
  from .health_check_response import HealthCheckResponse as HealthCheckResponse
12
13
  from .session_create_params import SessionCreateParams as SessionCreateParams
13
14
  from .session_list_response import SessionListResponse as SessionListResponse
@@ -0,0 +1,26 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Optional
4
+ from datetime import datetime
5
+ from typing_extensions import TypeAlias
6
+
7
+ from .._models import BaseModel
8
+
9
+ __all__ = ["DatasetListResponse", "DatasetListResponseItem"]
10
+
11
+
12
+ class DatasetListResponseItem(BaseModel):
13
+ name: str
14
+ """Unique name of the dataset."""
15
+
16
+ sample_count: int
17
+ """Number of samples in the dataset."""
18
+
19
+ created_at: Optional[datetime] = None
20
+ """Timestamp when the dataset was first created (UTC)."""
21
+
22
+ description: Optional[str] = None
23
+ """A brief description of the dataset."""
24
+
25
+
26
+ DatasetListResponse: TypeAlias = List[DatasetListResponseItem]
codeset/types/session.py CHANGED
@@ -12,17 +12,14 @@ __all__ = ["Session"]
12
12
 
13
13
 
14
14
  class Session(BaseModel):
15
- created_at: datetime
16
- """Timestamp when the session was created (UTC)."""
17
-
18
15
  dataset: str
19
16
  """Dataset name for the sample."""
20
17
 
21
18
  expires_at: datetime
22
19
  """Timestamp when the session will expire (UTC)."""
23
20
 
24
- last_activity_at: datetime
25
- """Timestamp of last activity in the session (UTC)."""
21
+ requested_at: datetime
22
+ """Timestamp when the session was requested (UTC)."""
26
23
 
27
24
  sample_id: str
28
25
  """Identifier of the sample being used for the session."""
@@ -39,8 +36,11 @@ class Session(BaseModel):
39
36
  container_info: Optional[ContainerInfo] = None
40
37
  """Information about a container."""
41
38
 
39
+ created_at: Optional[datetime] = None
40
+ """Timestamp when the container became ready and billing started (UTC)."""
41
+
42
42
  duration_seconds: Optional[float] = None
43
- """Current duration of the session in seconds."""
43
+ """Duration of the session in seconds."""
44
44
 
45
45
  error: Optional[ErrorInfo] = None
46
46
  """Details about an error that occurred during job processing."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: codeset
3
- Version: 0.1.0a14
3
+ Version: 0.1.0a16
4
4
  Summary: The official Python library for the codeset API
5
5
  Project-URL: Homepage, https://github.com/codeset-ai/codeset-sdk
6
6
  Project-URL: Repository, https://github.com/codeset-ai/codeset-sdk
@@ -1,6 +1,6 @@
1
1
  codeset/__init__.py,sha256=bCjaeGGvG-8IR-LHnLeZwkKv9qVWMgtPGaoviEF1Pts,2633
2
2
  codeset/_base_client.py,sha256=9m787ZxSExBGO-JvBP795LQ3RYx39x5PzaPMsujmFzw,67048
3
- codeset/_client.py,sha256=8O2aoX1oaT8w3rojNmSbOO1TgW6z6P61Md3LgxAE7uI,16616
3
+ codeset/_client.py,sha256=ThiXE2-F4SJAjhZ2wOe1aKgWoqNLT8IPyLcZLElR0Xs,17178
4
4
  codeset/_compat.py,sha256=DQBVORjFb33zch24jzkhM14msvnzY7mmSmgDLaVFUM8,6562
5
5
  codeset/_constants.py,sha256=SiR7F9XqRp2zFGI5kXnK7smZu4Ek80R8bg6EGeH0SqI,464
6
6
  codeset/_exceptions.py,sha256=b6V9pgGqb8KEwAif3Qw9PuGjOr3eCJo25n89ZWBKZlw,3222
@@ -11,7 +11,7 @@ codeset/_resource.py,sha256=MhmvrwixEq6echG2IFv1gO_nE_zfFTNw65s0JjsMee0,1106
11
11
  codeset/_response.py,sha256=lC6V1z6Az0X_Rk9MgwN8hOzYUSEwtp6_py_H3agR04A,28794
12
12
  codeset/_streaming.py,sha256=HqkgFE-gv9S7T4QfGa5pD4suEOvQ8BHZRxJR_NQcXak,10104
13
13
  codeset/_types.py,sha256=VRDtyYVMs3WfFHJBcoUb5Vxjs5sAe0mQWYP-BnLyMQg,7237
14
- codeset/_version.py,sha256=SrFbDKm5k_IPZL4roF7Qax7mT7E4HKeKrWb4Ig7dt5U,168
14
+ codeset/_version.py,sha256=A78e6H0A1rOYiu9x-ZJwWYmhDjX_S_7BHv-eiA2wiVc,168
15
15
  codeset/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  codeset/_utils/__init__.py,sha256=7fch0GT9zpNnErbciSpUNa-SjTxxjY6kxHxKMOM4AGs,2305
17
17
  codeset/_utils/_compat.py,sha256=D8gtAvjJQrDWt9upS0XaG9Rr5l1QhiAx_I_1utT_tt0,1195
@@ -26,20 +26,22 @@ codeset/_utils/_transform.py,sha256=NjCzmnfqYrsAikUHQig6N9QfuTVbKipuP3ur9mcNF-E,
26
26
  codeset/_utils/_typing.py,sha256=N_5PPuFNsaygbtA_npZd98SVN1LQQvFTKL6bkWPBZGU,4786
27
27
  codeset/_utils/_utils.py,sha256=0dDqauUbVZEXV0NVl7Bwu904Wwo5eyFCZpQThhFNhyA,12253
28
28
  codeset/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
29
- codeset/resources/__init__.py,sha256=32sOQt72KXOla0dUQqu1djbaLIWbd6zukrIh9Gotws0,1491
29
+ codeset/resources/__init__.py,sha256=EDBQUuv365y3NSSxTAoV0yL9ea71emPMFJF52YSclgI,1967
30
+ codeset/resources/datasets.py,sha256=gmQ-EAxxvLDqQmo0BZTUmvpT9hLhogi2RaAE3Bf5ixE,4929
30
31
  codeset/resources/health.py,sha256=yjMq6lObrPoUCL71YteI-N9WbV7vvXnvvD60Di-iX7Y,4859
31
32
  codeset/resources/samples.py,sha256=nC3FoVC7OgLTbwvXuLbO3hbHMohELiqCEl1MMuy6qHM,9925
32
33
  codeset/resources/sessions/__init__.py,sha256=NinDKd-EXVeconYzUm9S-pKs1VHxZUCWFsascKZLdRQ,1028
33
34
  codeset/resources/sessions/sessions.py,sha256=GlxXAhgpLaNVsIyAyRIzZQrIFraVfFnlK2jVvmu65Oc,24567
34
35
  codeset/resources/sessions/verify.py,sha256=G5sXSbTQHQ-FYGo8yfKHM91olilYn2GR3pP_3uDSIOs,9334
35
- codeset/types/__init__.py,sha256=QqhNk1L9Q45Wi-B8UqZD1TDm6sBRWBxU1wNkaAwUMa4,1352
36
+ codeset/types/__init__.py,sha256=hPKGwnOGUznCjBCKoje0piJ4ytlI0Qm4Xhso6r1xB6U,1430
36
37
  codeset/types/container_info.py,sha256=hhcVMX2nUmuaSTDBiSnJGQZQVYTlbDG57WUxwXazX2M,618
38
+ codeset/types/dataset_list_response.py,sha256=gR-UJDaTPi75JNVCbbZWLHoeJ8osHNsgQP5EeTAhdwk,704
37
39
  codeset/types/error_info.py,sha256=1yThCkLmcA_bA31pLlm4h-tk9TsmqnPb0yS5p1UQBPI,305
38
40
  codeset/types/health_check_response.py,sha256=hHMXvlEIQj98rsbkiKSX2SZaaRl-3mVuAFKY5k1FM_c,437
39
41
  codeset/types/sample_download_params.py,sha256=tRPvOupAg4rkWgdtQlWYKQHqbvTZIQYNM4u8TwLyuAE,346
40
42
  codeset/types/sample_list_params.py,sha256=OPtSgytRJH4m_9_qjBzxCpST8pTOFovgzXNupcqnxJY,341
41
43
  codeset/types/sample_list_response.py,sha256=KtllR5nvU-XZTzDb2U_vlOcpIe9bDobI6mRleBUyAos,1182
42
- codeset/types/session.py,sha256=94SPbObawjAtw1itb6GXYG4TV3sBxITIiofETsED9bU,1236
44
+ codeset/types/session.py,sha256=SDQo7a3FbNxfgN0xW6JL2hqviV8o5fKXO0eHE4DksgE,1263
43
45
  codeset/types/session_close_response.py,sha256=_vWgm4IHWcwUuw4lmGolEG3CkIv0H0A5yf8eaWB4f-I,342
44
46
  codeset/types/session_create_params.py,sha256=cFl5O1jI5qAjh9SqfLRerHo10TnY4QIYwi9j1Fv70MY,504
45
47
  codeset/types/session_create_response.py,sha256=87vgZPPCI3qA4_Gc8oS32RzglhwGSf7fgYxXOplrSYM,494
@@ -53,7 +55,7 @@ codeset/types/sessions/__init__.py,sha256=hRiBeT3umo01iicnTjI3UOh_Q6AspqzyyG-OEt
53
55
  codeset/types/sessions/job_status.py,sha256=347Rz0GmlCYv5yeHJnsG-Ddr5xkpKvX2sHXYRz0opXI,262
54
56
  codeset/types/sessions/verify_start_response.py,sha256=Dk1iyafuj1IAL39VQji_znUUMxDXI8QXn2QKB-ME4uw,482
55
57
  codeset/types/sessions/verify_status_response.py,sha256=hjYWo5nJdsznnPWmfVF0T5Hw9WfB8b06VtkYqhCMX0k,1983
56
- codeset-0.1.0a14.dist-info/METADATA,sha256=qHRczh3uGlEgywUxVowWJ-zReVI675jT9_hKJMIqtrE,13382
57
- codeset-0.1.0a14.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
58
- codeset-0.1.0a14.dist-info/licenses/LICENSE,sha256=SzrebAd3MnL58zf3dEBLJvstQvQe33mCCY2TmzKEmY8,11337
59
- codeset-0.1.0a14.dist-info/RECORD,,
58
+ codeset-0.1.0a16.dist-info/METADATA,sha256=PGMCqQONF29RK_X7BazaedzPBNFFplRsMWrGR4oomhs,13382
59
+ codeset-0.1.0a16.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
60
+ codeset-0.1.0a16.dist-info/licenses/LICENSE,sha256=SzrebAd3MnL58zf3dEBLJvstQvQe33mCCY2TmzKEmY8,11337
61
+ codeset-0.1.0a16.dist-info/RECORD,,