ecmwf-datastores-client 0.3.0__py3-none-any.whl → 0.4.0__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 ecmwf-datastores-client might be problematic. Click here for more details.
- ecmwf/datastores/processing.py +13 -10
- ecmwf/datastores/version.py +1 -1
- {ecmwf_datastores_client-0.3.0.dist-info → ecmwf_datastores_client-0.4.0.dist-info}/METADATA +7 -6
- {ecmwf_datastores_client-0.3.0.dist-info → ecmwf_datastores_client-0.4.0.dist-info}/RECORD +7 -7
- {ecmwf_datastores_client-0.3.0.dist-info → ecmwf_datastores_client-0.4.0.dist-info}/WHEEL +0 -0
- {ecmwf_datastores_client-0.3.0.dist-info → ecmwf_datastores_client-0.4.0.dist-info}/licenses/LICENSE +0 -0
- {ecmwf_datastores_client-0.3.0.dist-info → ecmwf_datastores_client-0.4.0.dist-info}/top_level.txt +0 -0
ecmwf/datastores/processing.py
CHANGED
|
@@ -21,7 +21,7 @@ import os
|
|
|
21
21
|
import time
|
|
22
22
|
import urllib.parse
|
|
23
23
|
import warnings
|
|
24
|
-
from typing import Any, Callable,
|
|
24
|
+
from typing import Any, Callable, TypedDict, TypeVar
|
|
25
25
|
|
|
26
26
|
try:
|
|
27
27
|
from typing import Self
|
|
@@ -144,7 +144,7 @@ class ApiResponse:
|
|
|
144
144
|
|
|
145
145
|
@classmethod
|
|
146
146
|
def from_request(
|
|
147
|
-
cls:
|
|
147
|
+
cls: type[T_ApiResponse],
|
|
148
148
|
method: str,
|
|
149
149
|
url: str,
|
|
150
150
|
headers: dict[str, str],
|
|
@@ -620,13 +620,16 @@ class Results(ApiResponse):
|
|
|
620
620
|
def _download(self, url: str, target: str) -> requests.Response:
|
|
621
621
|
download_options = {"stream": True, "resume_transfers": True}
|
|
622
622
|
download_options.update(self.download_options)
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
623
|
+
try:
|
|
624
|
+
multiurl.download(
|
|
625
|
+
url,
|
|
626
|
+
target=target,
|
|
627
|
+
maximum_retries=0,
|
|
628
|
+
**self.request_options,
|
|
629
|
+
**download_options,
|
|
630
|
+
)
|
|
631
|
+
except requests.HTTPError as exc:
|
|
632
|
+
return exc.response
|
|
630
633
|
return requests.Response() # mutliurl robust needs a response
|
|
631
634
|
|
|
632
635
|
def download(
|
|
@@ -661,7 +664,7 @@ class Results(ApiResponse):
|
|
|
661
664
|
@property
|
|
662
665
|
def location(self) -> str:
|
|
663
666
|
"""File location."""
|
|
664
|
-
result_href = self.asset["href"]
|
|
667
|
+
result_href: str = self.asset["href"]
|
|
665
668
|
return urllib.parse.urljoin(self.response.url, result_href)
|
|
666
669
|
|
|
667
670
|
@property
|
ecmwf/datastores/version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# Do not change! Do not track in version control!
|
|
2
|
-
__version__ = "0.
|
|
2
|
+
__version__ = "0.4.0"
|
{ecmwf_datastores_client-0.3.0.dist-info → ecmwf_datastores_client-0.4.0.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ecmwf-datastores-client
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: ECMWF Data Stores Service (DSS) API Python client
|
|
5
5
|
License: Apache License
|
|
6
6
|
Version 2.0, January 2004
|
|
@@ -213,18 +213,17 @@ Classifier: License :: OSI Approved :: Apache Software License
|
|
|
213
213
|
Classifier: Operating System :: OS Independent
|
|
214
214
|
Classifier: Programming Language :: Python
|
|
215
215
|
Classifier: Programming Language :: Python :: 3
|
|
216
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
217
216
|
Classifier: Programming Language :: Python :: 3.9
|
|
218
217
|
Classifier: Programming Language :: Python :: 3.10
|
|
219
218
|
Classifier: Programming Language :: Python :: 3.11
|
|
220
219
|
Classifier: Programming Language :: Python :: 3.12
|
|
221
220
|
Classifier: Programming Language :: Python :: 3.13
|
|
222
221
|
Classifier: Topic :: Scientific/Engineering
|
|
223
|
-
Requires-Python: >=3.
|
|
222
|
+
Requires-Python: >=3.9
|
|
224
223
|
Description-Content-Type: text/markdown
|
|
225
224
|
License-File: LICENSE
|
|
226
225
|
Requires-Dist: attrs
|
|
227
|
-
Requires-Dist: multiurl>=0.3.
|
|
226
|
+
Requires-Dist: multiurl>=0.3.7
|
|
228
227
|
Requires-Dist: requests
|
|
229
228
|
Requires-Dist: typing-extensions
|
|
230
229
|
Provides-Extra: legacy
|
|
@@ -322,8 +321,8 @@ Retrieve data:
|
|
|
322
321
|
... "time": ["00:00"],
|
|
323
322
|
... "pressure_level": ["1000"],
|
|
324
323
|
... "data_format": "grib",
|
|
325
|
-
... "download_format": "unarchived"
|
|
326
|
-
...
|
|
324
|
+
... "download_format": "unarchived",
|
|
325
|
+
... }
|
|
327
326
|
|
|
328
327
|
>>> client.retrieve(collection_id, request, target="target_1.grib") # blocks
|
|
329
328
|
'target_1.grib'
|
|
@@ -359,6 +358,7 @@ List all collection IDs sorted by last update:
|
|
|
359
358
|
>>> while collections is not None: # Loop over pages
|
|
360
359
|
... collection_ids.extend(collections.collection_ids)
|
|
361
360
|
... collections = collections.next # Move to the next page
|
|
361
|
+
...
|
|
362
362
|
|
|
363
363
|
>>> collection_ids
|
|
364
364
|
[...]
|
|
@@ -425,6 +425,7 @@ List all successful jobs, sorted by newest first:
|
|
|
425
425
|
>>> while jobs is not None: # Loop over pages
|
|
426
426
|
... request_ids.extend(jobs.request_ids)
|
|
427
427
|
... jobs = jobs.next # Move to the next page
|
|
428
|
+
...
|
|
428
429
|
|
|
429
430
|
>>> request_ids
|
|
430
431
|
[...]
|
|
@@ -3,13 +3,13 @@ ecmwf/datastores/catalogue.py,sha256=I-ON4lxI13Y5dR7joU1qeQrWTxYBQMFGYoOrLa2oLic
|
|
|
3
3
|
ecmwf/datastores/client.py,sha256=bCXSb1q3T-kX7csOshi4z6qU54s8JrczPVbEPxa_UiA,13053
|
|
4
4
|
ecmwf/datastores/config.py,sha256=45C4nvgk-uGucCAnN3bUtr_zv-_dm8IN_P5xl7LPqfs,1497
|
|
5
5
|
ecmwf/datastores/legacy_client.py,sha256=UEkQNg9IA_zNnpZrc4I9O2X2h39NsaxYM0xpL2OKghA,9491
|
|
6
|
-
ecmwf/datastores/processing.py,sha256=
|
|
6
|
+
ecmwf/datastores/processing.py,sha256=KDV2rwNdWZHaXNqorSO-BRg8fuqxv5or3Z8s4-rDSYY,22204
|
|
7
7
|
ecmwf/datastores/profile.py,sha256=VjT6GSoSZZyaDHXZh0SQbrzxSX3Ug2DOWhq7VIu-QX8,2974
|
|
8
8
|
ecmwf/datastores/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
ecmwf/datastores/utils.py,sha256=fc6wma5qRpgAsX3dOmg0aoIc-qjWG6NY9PSHaWR8CpE,320
|
|
10
|
-
ecmwf/datastores/version.py,sha256
|
|
11
|
-
ecmwf_datastores_client-0.
|
|
12
|
-
ecmwf_datastores_client-0.
|
|
13
|
-
ecmwf_datastores_client-0.
|
|
14
|
-
ecmwf_datastores_client-0.
|
|
15
|
-
ecmwf_datastores_client-0.
|
|
10
|
+
ecmwf/datastores/version.py,sha256=-UXII43tJWWG-Bw3-ObfEfbloOAVS2Clozd55E6zYvA,72
|
|
11
|
+
ecmwf_datastores_client-0.4.0.dist-info/licenses/LICENSE,sha256=e2Qp4JUZeHZZSYCADyp1B3siZB5aQE5MRCYRx7vqlNI,11346
|
|
12
|
+
ecmwf_datastores_client-0.4.0.dist-info/METADATA,sha256=6WXpiRL6szWCjZn8rHWa4OJkhhe0rAKXy_qZZioT64I,21418
|
|
13
|
+
ecmwf_datastores_client-0.4.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
14
|
+
ecmwf_datastores_client-0.4.0.dist-info/top_level.txt,sha256=gvA9-Z3hRaFzijz-mf8v2t84s25ptpWeqhyuUomJoJk,6
|
|
15
|
+
ecmwf_datastores_client-0.4.0.dist-info/RECORD,,
|
|
File without changes
|
{ecmwf_datastores_client-0.3.0.dist-info → ecmwf_datastores_client-0.4.0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{ecmwf_datastores_client-0.3.0.dist-info → ecmwf_datastores_client-0.4.0.dist-info}/top_level.txt
RENAMED
|
File without changes
|