pybiolib 1.1.1881__py3-none-any.whl → 1.1.1890__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.
- biolib/_internal/data_record/data_record.py +2 -1
- biolib/biolib_binary_format/utils.py +14 -1
- {pybiolib-1.1.1881.dist-info → pybiolib-1.1.1890.dist-info}/METADATA +1 -1
- {pybiolib-1.1.1881.dist-info → pybiolib-1.1.1890.dist-info}/RECORD +7 -7
- {pybiolib-1.1.1881.dist-info → pybiolib-1.1.1890.dist-info}/LICENSE +0 -0
- {pybiolib-1.1.1881.dist-info → pybiolib-1.1.1890.dist-info}/WHEEL +0 -0
- {pybiolib-1.1.1881.dist-info → pybiolib-1.1.1890.dist-info}/entry_points.txt +0 -0
@@ -60,7 +60,8 @@ class DataRecord:
|
|
60
60
|
file_path = os.path.join(output_dir, file.path)
|
61
61
|
os.makedirs(os.path.dirname(file_path), exist_ok=True)
|
62
62
|
with open(file_path, mode='wb') as file_handle:
|
63
|
-
|
63
|
+
for chunk in file.get_data_iterator():
|
64
|
+
file_handle.write(chunk)
|
64
65
|
|
65
66
|
def save_files(self, output_dir: str, path_filter: Optional[PathFilter] = None) -> None:
|
66
67
|
self.download_files(output_dir=output_dir, path_filter=path_filter)
|
@@ -1,7 +1,8 @@
|
|
1
1
|
from abc import ABC, abstractmethod
|
2
2
|
import io
|
3
|
+
import math
|
3
4
|
from typing import Optional, Callable
|
4
|
-
|
5
|
+
from biolib.typing_utils import Iterator
|
5
6
|
from biolib._internal.http_client import HttpClient
|
6
7
|
|
7
8
|
|
@@ -149,3 +150,15 @@ class LazyLoadedFile:
|
|
149
150
|
|
150
151
|
def get_data(self) -> bytes:
|
151
152
|
return self._buffer.get_data(start=self.start, length=self._length)
|
153
|
+
|
154
|
+
def get_data_iterator(self) -> Iterator[bytes]:
|
155
|
+
if self._length == 0:
|
156
|
+
yield b''
|
157
|
+
else:
|
158
|
+
chunk_size = 100_000
|
159
|
+
chunks_to_yield = math.ceil(self._length / chunk_size)
|
160
|
+
for chunk_idx in range(chunks_to_yield - 1):
|
161
|
+
yield self._buffer.get_data(start=self.start+chunk_idx*chunk_size, length=chunk_size)
|
162
|
+
data_already_yielded = (chunks_to_yield - 1)*chunk_size
|
163
|
+
yield self._buffer.get_data(start=self.start+data_already_yielded,
|
164
|
+
length=self._length - data_already_yielded)
|
@@ -3,7 +3,7 @@ README.md,sha256=_IH7pxFiqy2bIAmaVeA-iVTyUwWRjMIlfgtUbYTtmls,368
|
|
3
3
|
biolib/__init__.py,sha256=nfZvVkrHZLvjvvlAvFzhvem9NMfqgmw8NWaCH9HGzew,4045
|
4
4
|
biolib/_internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
biolib/_internal/data_record/__init__.py,sha256=1Bk303i3rFet9veS56fIsrBYtT5X3n9vcsYMA6T6c5o,36
|
6
|
-
biolib/_internal/data_record/data_record.py,sha256=
|
6
|
+
biolib/_internal/data_record/data_record.py,sha256=8wFFikkOnft41u2l9T3LR86oKJ7CVoxTlLiSleQV4R0,6588
|
7
7
|
biolib/_internal/data_record/remote_storage_endpoint.py,sha256=LPq8Lr5FhKF9_o5K-bUdT7TeLe5XFUD0AAeTkNEVZug,1133
|
8
8
|
biolib/_internal/http_client.py,sha256=cSBIzh00x2HL3BmLxt_GvDI7bWQMNytv_wOy7EXg8kI,4064
|
9
9
|
biolib/_internal/push_application.py,sha256=H1PGNtVJ0vRC0li39gFMpPpjm6QeZ8Ob-7cLkLmxS_Y,10009
|
@@ -35,7 +35,7 @@ biolib/biolib_binary_format/saved_job.py,sha256=nFHVFRNTNcAFGODLSiBntCtMk55QKwre
|
|
35
35
|
biolib/biolib_binary_format/stdout_and_stderr.py,sha256=WfUUJFFCBrtfXjuWIaRPiWCpuBLxfko68oxoTKhrwx8,1023
|
36
36
|
biolib/biolib_binary_format/system_exception.py,sha256=T3iL4_cSHAHim3RSDPS8Xyb1mfteaJBZonSXuRltc28,853
|
37
37
|
biolib/biolib_binary_format/system_status_update.py,sha256=aOELuQ0k-GtpaZTUxYd0GFomP_OInmrK585y6fuQuKE,1191
|
38
|
-
biolib/biolib_binary_format/utils.py,sha256=
|
38
|
+
biolib/biolib_binary_format/utils.py,sha256=ZjX97zOmu9mvntgLfBEb6w37Yb013Ns2ikBVPKX1gCI,4811
|
39
39
|
biolib/biolib_docker_client/__init__.py,sha256=aBfA6mtWSI5dBEfNNMD6bIZzCPloW4ghKm0wqQiljdo,1481
|
40
40
|
biolib/biolib_download_container.py,sha256=8TmBV8iv3bCvkNlHa1SSsc4zl0wX_eaxhfnW5rvFIh8,1779
|
41
41
|
biolib/biolib_errors.py,sha256=5m4lK2l39DafpoXBImEBD4EPH3ayXBX0JgtPzmGClow,689
|
@@ -105,8 +105,8 @@ biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3
|
|
105
105
|
biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
|
106
106
|
biolib/utils/seq_util.py,sha256=jC5WhH63FTD7SLFJbxQGA2hOt9NTwq9zHl_BEec1Z0c,4907
|
107
107
|
biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
|
108
|
-
pybiolib-1.1.
|
109
|
-
pybiolib-1.1.
|
110
|
-
pybiolib-1.1.
|
111
|
-
pybiolib-1.1.
|
112
|
-
pybiolib-1.1.
|
108
|
+
pybiolib-1.1.1890.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
|
109
|
+
pybiolib-1.1.1890.dist-info/METADATA,sha256=A-JSYORWBycwRtJJMFEaTNsBm1mEVjhXtIJRrjqhn6A,1508
|
110
|
+
pybiolib-1.1.1890.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
111
|
+
pybiolib-1.1.1890.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
|
112
|
+
pybiolib-1.1.1890.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|