datalab-api 0.2.9__tar.gz → 0.2.10__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.
- {datalab_api-0.2.9/src/datalab_api.egg-info → datalab_api-0.2.10}/PKG-INFO +3 -2
- {datalab_api-0.2.9 → datalab_api-0.2.10}/src/datalab_api/__init__.py +3 -2
- {datalab_api-0.2.9 → datalab_api-0.2.10}/src/datalab_api/_base.py +1 -1
- {datalab_api-0.2.9 → datalab_api-0.2.10/src/datalab_api.egg-info}/PKG-INFO +3 -2
- {datalab_api-0.2.9 → datalab_api-0.2.10}/tests/test_client.py +7 -1
- {datalab_api-0.2.9 → datalab_api-0.2.10}/LICENSE +0 -0
- {datalab_api-0.2.9 → datalab_api-0.2.10}/README.md +0 -0
- {datalab_api-0.2.9 → datalab_api-0.2.10}/pyproject.toml +0 -0
- {datalab_api-0.2.9 → datalab_api-0.2.10}/setup.cfg +0 -0
- {datalab_api-0.2.9 → datalab_api-0.2.10}/src/datalab_api/cli.py +0 -0
- {datalab_api-0.2.9 → datalab_api-0.2.10}/src/datalab_api/helpers.py +0 -0
- {datalab_api-0.2.9 → datalab_api-0.2.10}/src/datalab_api.egg-info/SOURCES.txt +0 -0
- {datalab_api-0.2.9 → datalab_api-0.2.10}/src/datalab_api.egg-info/dependency_links.txt +0 -0
- {datalab_api-0.2.9 → datalab_api-0.2.10}/src/datalab_api.egg-info/entry_points.txt +0 -0
- {datalab_api-0.2.9 → datalab_api-0.2.10}/src/datalab_api.egg-info/requires.txt +0 -0
- {datalab_api-0.2.9 → datalab_api-0.2.10}/src/datalab_api.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: datalab-api
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.10
|
|
4
4
|
Summary: A Python API for instances of the datalab data management platform (https://github.com/datalab-org/datalab).
|
|
5
5
|
Author-email: Matthew Evans <matthew@ml-evs.science>
|
|
6
6
|
License: MIT
|
|
@@ -43,6 +43,7 @@ Requires-Dist: pandas~=2.2; extra == "cheminventory-helper"
|
|
|
43
43
|
Requires-Dist: openpyxl~=3.0; extra == "cheminventory-helper"
|
|
44
44
|
Provides-Extra: all
|
|
45
45
|
Requires-Dist: datalab-api[cli,dev,docs]; extra == "all"
|
|
46
|
+
Dynamic: license-file
|
|
46
47
|
|
|
47
48
|
# <div align="center"><i>datalab</i> Python API</div>
|
|
48
49
|
|
|
@@ -282,8 +282,9 @@ class DatalabClient(BaseDatalabClient):
|
|
|
282
282
|
warnings.warn(f"Will not overwrite existing file {f['name']}")
|
|
283
283
|
continue
|
|
284
284
|
with open(f["name"], "wb") as file:
|
|
285
|
-
|
|
286
|
-
|
|
285
|
+
with self.session.stream("GET", url, follow_redirects=True) as response:
|
|
286
|
+
for chunk in response.iter_bytes(chunk_size=1024):
|
|
287
|
+
file.write(chunk)
|
|
287
288
|
|
|
288
289
|
def get_block(self, item_id: str, block_id: str, block_data: dict[str, Any]) -> dict[str, Any]:
|
|
289
290
|
"""Get a block with a given ID and block data.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: datalab-api
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.10
|
|
4
4
|
Summary: A Python API for instances of the datalab data management platform (https://github.com/datalab-org/datalab).
|
|
5
5
|
Author-email: Matthew Evans <matthew@ml-evs.science>
|
|
6
6
|
License: MIT
|
|
@@ -43,6 +43,7 @@ Requires-Dist: pandas~=2.2; extra == "cheminventory-helper"
|
|
|
43
43
|
Requires-Dist: openpyxl~=3.0; extra == "cheminventory-helper"
|
|
44
44
|
Provides-Extra: all
|
|
45
45
|
Requires-Dist: datalab-api[cli,dev,docs]; extra == "all"
|
|
46
|
+
Dynamic: license-file
|
|
46
47
|
|
|
47
48
|
# <div align="center"><i>datalab</i> Python API</div>
|
|
48
49
|
|
|
@@ -28,7 +28,7 @@ def test_redirect_url(fake_ui_html, fake_info_json, fake_block_info_json):
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
@respx.mock
|
|
31
|
-
def test_sample_list(fake_samples_json, fake_info_json, fake_block_info_json):
|
|
31
|
+
def test_sample_list(fake_samples_json, fake_info_json, fake_sample_json, fake_block_info_json):
|
|
32
32
|
fake_api = respx.get("https://api.datalab.industries/").mock(
|
|
33
33
|
return_value=Response(200, content="<!doctype html></html>")
|
|
34
34
|
)
|
|
@@ -41,6 +41,9 @@ def test_sample_list(fake_samples_json, fake_info_json, fake_block_info_json):
|
|
|
41
41
|
fake_block_info_api = respx.get("https://api.datalab.industries/info/blocks").mock(
|
|
42
42
|
return_value=Response(200, json=fake_block_info_json)
|
|
43
43
|
)
|
|
44
|
+
fake_item_api = respx.get("https://api.datalab.industries/get-item-data/KUVEKJ").mock(
|
|
45
|
+
return_value=Response(200, json=fake_sample_json)
|
|
46
|
+
)
|
|
44
47
|
with DatalabClient("https://api.datalab.industries") as client:
|
|
45
48
|
samples = client.get_items(display=True)
|
|
46
49
|
assert fake_samples_api.called
|
|
@@ -49,3 +52,6 @@ def test_sample_list(fake_samples_json, fake_info_json, fake_block_info_json):
|
|
|
49
52
|
assert fake_block_info_api.called
|
|
50
53
|
assert len(samples)
|
|
51
54
|
assert samples[0]["item_id"] == "test"
|
|
55
|
+
sample = client.get_item("KUVEKJ", display=True)
|
|
56
|
+
assert fake_item_api.called
|
|
57
|
+
assert sample["item_id"] == "KUVEKJ"
|
|
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
|