kotharcomputing 1.4.0__tar.gz → 1.5.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.
Files changed (17) hide show
  1. {kotharcomputing-1.4.0 → kotharcomputing-1.5.0}/PKG-INFO +28 -1
  2. {kotharcomputing-1.4.0 → kotharcomputing-1.5.0}/README.md +27 -0
  3. {kotharcomputing-1.4.0 → kotharcomputing-1.5.0}/pyproject.toml +1 -1
  4. {kotharcomputing-1.4.0 → kotharcomputing-1.5.0}/src/kotharcomputing/_generated/operations.py +19 -3
  5. {kotharcomputing-1.4.0 → kotharcomputing-1.5.0}/src/kotharcomputing/_generated/types.py +47 -9
  6. {kotharcomputing-1.4.0 → kotharcomputing-1.5.0}/src/kotharcomputing.egg-info/PKG-INFO +28 -1
  7. {kotharcomputing-1.4.0 → kotharcomputing-1.5.0}/setup.cfg +0 -0
  8. {kotharcomputing-1.4.0 → kotharcomputing-1.5.0}/src/kotharcomputing/__init__.py +0 -0
  9. {kotharcomputing-1.4.0 → kotharcomputing-1.5.0}/src/kotharcomputing/_generated/__init__.py +0 -0
  10. {kotharcomputing-1.4.0 → kotharcomputing-1.5.0}/src/kotharcomputing/aleph_language_server.py +0 -0
  11. {kotharcomputing-1.4.0 → kotharcomputing-1.5.0}/src/kotharcomputing/client.py +0 -0
  12. {kotharcomputing-1.4.0 → kotharcomputing-1.5.0}/src/kotharcomputing/errors.py +0 -0
  13. {kotharcomputing-1.4.0 → kotharcomputing-1.5.0}/src/kotharcomputing/py.typed +0 -0
  14. {kotharcomputing-1.4.0 → kotharcomputing-1.5.0}/src/kotharcomputing/transport.py +0 -0
  15. {kotharcomputing-1.4.0 → kotharcomputing-1.5.0}/src/kotharcomputing.egg-info/SOURCES.txt +0 -0
  16. {kotharcomputing-1.4.0 → kotharcomputing-1.5.0}/src/kotharcomputing.egg-info/dependency_links.txt +0 -0
  17. {kotharcomputing-1.4.0 → kotharcomputing-1.5.0}/src/kotharcomputing.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kotharcomputing
3
- Version: 1.4.0
3
+ Version: 1.5.0
4
4
  Summary: Python SDK for the Kothar API
5
5
  Author: Kothar Computing
6
6
  License-Expression: Apache-2.0
@@ -53,3 +53,30 @@ parsed = aleph.ast('print("hello")', format=True, discover_test=True)
53
53
  tests = aleph.discover_tests('test "example" {}')
54
54
  formatted = aleph.format('print( "hello" )')
55
55
  ```
56
+
57
+ ## HDF5 dataset reads
58
+
59
+ Generated operations use GET with no body and encode a nested `ranges` array as
60
+ one JSON query parameter. Use `[]` for scalar/null dataspaces.
61
+
62
+ ```python
63
+ from kotharcomputing import ApiTransport
64
+ from kotharcomputing._generated.operations import read_file_dataset
65
+
66
+ transport = ApiTransport("https://api.kotharcomputing.com", access_token="YOUR_TOKEN")
67
+ response = read_file_dataset(
68
+ transport,
69
+ workspace_id="WORKSPACE_ID",
70
+ path="measurements.h5",
71
+ version_id="immutable-version-id",
72
+ object_path="/samples",
73
+ ranges=[[0, 10, 2]],
74
+ )
75
+ selection = response.json() # shape, datatype, values; optional base64 data
76
+ ```
77
+
78
+ Use `representation="binary"` and `response.body` for little-endian numeric/enum
79
+ bytes or decoded scalar-string bytes; `response.headers` preserves identity and
80
+ dtype metadata. Fixed-length string arrays require JSON. Enum symbols contain
81
+ exact decimal codes; JSON values retain the existing 64-bit tags. External callers
82
+ must replace POST reads with GET; stored files need no migration.
@@ -36,3 +36,30 @@ parsed = aleph.ast('print("hello")', format=True, discover_test=True)
36
36
  tests = aleph.discover_tests('test "example" {}')
37
37
  formatted = aleph.format('print( "hello" )')
38
38
  ```
39
+
40
+ ## HDF5 dataset reads
41
+
42
+ Generated operations use GET with no body and encode a nested `ranges` array as
43
+ one JSON query parameter. Use `[]` for scalar/null dataspaces.
44
+
45
+ ```python
46
+ from kotharcomputing import ApiTransport
47
+ from kotharcomputing._generated.operations import read_file_dataset
48
+
49
+ transport = ApiTransport("https://api.kotharcomputing.com", access_token="YOUR_TOKEN")
50
+ response = read_file_dataset(
51
+ transport,
52
+ workspace_id="WORKSPACE_ID",
53
+ path="measurements.h5",
54
+ version_id="immutable-version-id",
55
+ object_path="/samples",
56
+ ranges=[[0, 10, 2]],
57
+ )
58
+ selection = response.json() # shape, datatype, values; optional base64 data
59
+ ```
60
+
61
+ Use `representation="binary"` and `response.body` for little-endian numeric/enum
62
+ bytes or decoded scalar-string bytes; `response.headers` preserves identity and
63
+ dtype metadata. Fixed-length string arrays require JSON. Enum symbols contain
64
+ exact decimal codes; JSON values retain the existing 64-bit tags. External callers
65
+ must replace POST reads with GET; stored files need no migration.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "kotharcomputing"
7
- version = "1.4.0"
7
+ version = "1.5.0"
8
8
  description = "Python SDK for the Kothar API"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -2,6 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ import json
5
6
  from typing import Any, Literal
6
7
 
7
8
  from ..transport import ApiTransport, RawResponse
@@ -1151,6 +1152,7 @@ def inspect_file(
1151
1152
  path: str,
1152
1153
  version_id: str | None = None,
1153
1154
  object_path: str,
1155
+ attributes: bool | None = None,
1154
1156
  offset: int | None = None,
1155
1157
  limit: int | None = None,
1156
1158
  ) -> Types.Hdf5Inspection:
@@ -1165,6 +1167,7 @@ def inspect_file(
1165
1167
  "path": path,
1166
1168
  "versionId": version_id,
1167
1169
  "objectPath": object_path,
1170
+ "attributes": attributes,
1168
1171
  "offset": offset,
1169
1172
  "limit": limit,
1170
1173
  },
@@ -1188,16 +1191,29 @@ def move_file(
1188
1191
 
1189
1192
 
1190
1193
  def read_file_dataset(
1191
- transport: ApiTransport, *, workspace_id: str, body: Types.Hdf5ReadRequest
1194
+ transport: ApiTransport,
1195
+ *,
1196
+ workspace_id: str,
1197
+ path: str,
1198
+ version_id: str,
1199
+ object_path: str,
1200
+ ranges: list[list[int]],
1201
+ representation: Literal["json", "binary"] | None = None,
1192
1202
  ) -> RawResponse:
1193
1203
  """Read a bounded HDF5 hyperslab from an immutable file version"""
1194
1204
  response = transport.raw(
1195
- "post",
1205
+ "get",
1196
1206
  "/v1/workspaces/{workspaceId}/files/$readDataset",
1197
1207
  path_params={
1198
1208
  "workspaceId": workspace_id,
1199
1209
  },
1200
- json_data=body,
1210
+ search_params={
1211
+ "path": path,
1212
+ "versionId": version_id,
1213
+ "objectPath": object_path,
1214
+ "ranges": json.dumps(ranges, separators=(",", ":")),
1215
+ "representation": representation,
1216
+ },
1201
1217
  )
1202
1218
  return response
1203
1219
 
@@ -851,7 +851,8 @@ class Hdf5ApplyManifest(TypedDict, total=False):
851
851
 
852
852
 
853
853
  class Hdf5DatasetResponse(TypedDict, total=False):
854
- data: Required[str]
854
+ data: NotRequired[str]
855
+ datatype: Required[Hdf5Datatype]
855
856
  dtype: Required[str]
856
857
  etag: Required[str]
857
858
  shape: Required[list[int]]
@@ -859,6 +860,35 @@ class Hdf5DatasetResponse(TypedDict, total=False):
859
860
  versionId: Required[str]
860
861
 
861
862
 
863
+ Hdf5Datatype = TypedDict(
864
+ "Hdf5Datatype",
865
+ {
866
+ "byteOrder": 'NotRequired[Literal["little", "big", "vax", "mixed", "none"]]',
867
+ # Compound fields or the array, sequence, or enum base type.
868
+ "children": "NotRequired[list[Hdf5Datatype]]",
869
+ # HDF5 class, including unsupported value types.
870
+ "class": "Required[str]",
871
+ # Array datatype dimensions, independent of dataset shape.
872
+ "dimensions": "NotRequired[list[int]]",
873
+ "encoding": 'NotRequired[Literal["ascii", "utf8"]]',
874
+ # Compound field name.
875
+ "name": "NotRequired[str]",
876
+ # Compound field byte offset.
877
+ "offset": "NotRequired[int]",
878
+ "padding": 'NotRequired[Literal["nullterm", "nullpad", "spacepad"]]',
879
+ "signed": "NotRequired[bool]",
880
+ # Storage size in bytes.
881
+ "size": "Required[int]",
882
+ # Enum symbols mapped to exact decimal integer codes.
883
+ "symbols": "NotRequired[dict[str, Any]]",
884
+ "truncated": "NotRequired[bool]",
885
+ # Whether a string has variable length.
886
+ "variable": "NotRequired[bool]",
887
+ },
888
+ total=False,
889
+ )
890
+
891
+
862
892
  class Hdf5Edit(TypedDict, total=False):
863
893
  attachment: NotRequired[int]
864
894
  attribute: NotRequired[str]
@@ -869,6 +899,12 @@ class Hdf5Edit(TypedDict, total=False):
869
899
  value: NotRequired[str]
870
900
 
871
901
 
902
+ class Hdf5Filter(TypedDict, total=False):
903
+ id: Required[int]
904
+ name: Required[str]
905
+ parameters: Required[list[int]]
906
+
907
+
872
908
  class Hdf5Inspection(TypedDict, total=False):
873
909
  etag: Required[str]
874
910
  node: Required[Hdf5Object]
@@ -883,20 +919,22 @@ class Hdf5MutationResponse(TypedDict, total=False):
883
919
  class Hdf5Object(TypedDict, total=False):
884
920
  attributes: NotRequired[dict[str, Any]]
885
921
  children: NotRequired[list[Hdf5Object]]
922
+ chunks: NotRequired[list[int]]
886
923
  dataspace: NotRequired[str]
924
+ datatype: NotRequired[Hdf5Datatype]
887
925
  dtype: NotRequired[str]
926
+ # External link filename; inspection never opens this file.
927
+ externalFile: NotRequired[str]
928
+ filters: NotRequired[list[Hdf5Filter]]
888
929
  kind: Required[str]
930
+ # Link target path; inspection never follows this link.
931
+ linkTarget: NotRequired[str]
889
932
  next: NotRequired[int]
890
933
  path: Required[str]
891
934
  shape: NotRequired[list[int]]
892
-
893
-
894
- class Hdf5ReadRequest(TypedDict, total=False):
895
- objectPath: Required[str]
896
- path: Required[str]
897
- ranges: Required[list[list[int]]]
898
- representation: NotRequired[Literal["json", "binary"]]
899
- versionId: Required[str]
935
+ # Attribute names requiring browser reading; metadata-only types and resource-limit
936
+ # failures are excluded.
937
+ unsupportedAttributes: NotRequired[list[str]]
900
938
 
901
939
 
902
940
  class HtmlRenderMargin(TypedDict, total=False):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kotharcomputing
3
- Version: 1.4.0
3
+ Version: 1.5.0
4
4
  Summary: Python SDK for the Kothar API
5
5
  Author: Kothar Computing
6
6
  License-Expression: Apache-2.0
@@ -53,3 +53,30 @@ parsed = aleph.ast('print("hello")', format=True, discover_test=True)
53
53
  tests = aleph.discover_tests('test "example" {}')
54
54
  formatted = aleph.format('print( "hello" )')
55
55
  ```
56
+
57
+ ## HDF5 dataset reads
58
+
59
+ Generated operations use GET with no body and encode a nested `ranges` array as
60
+ one JSON query parameter. Use `[]` for scalar/null dataspaces.
61
+
62
+ ```python
63
+ from kotharcomputing import ApiTransport
64
+ from kotharcomputing._generated.operations import read_file_dataset
65
+
66
+ transport = ApiTransport("https://api.kotharcomputing.com", access_token="YOUR_TOKEN")
67
+ response = read_file_dataset(
68
+ transport,
69
+ workspace_id="WORKSPACE_ID",
70
+ path="measurements.h5",
71
+ version_id="immutable-version-id",
72
+ object_path="/samples",
73
+ ranges=[[0, 10, 2]],
74
+ )
75
+ selection = response.json() # shape, datatype, values; optional base64 data
76
+ ```
77
+
78
+ Use `representation="binary"` and `response.body` for little-endian numeric/enum
79
+ bytes or decoded scalar-string bytes; `response.headers` preserves identity and
80
+ dtype metadata. Fixed-length string arrays require JSON. Enum symbols contain
81
+ exact decimal codes; JSON values retain the existing 64-bit tags. External callers
82
+ must replace POST reads with GET; stored files need no migration.