eodag 3.5.0__py3-none-any.whl → 3.6.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.
- eodag/api/core.py +44 -26
- eodag/api/product/__init__.py +30 -0
- eodag/api/product/_product.py +33 -0
- eodag/api/search_result.py +155 -1
- eodag/cli.py +54 -41
- eodag/config.py +2 -6
- eodag/plugins/download/base.py +15 -3
- eodag/plugins/search/build_search_result.py +11 -8
- eodag/plugins/search/qssearch.py +4 -1
- eodag/resources/ext_product_types.json +1 -1
- eodag/resources/product_types.yml +70 -0
- eodag/resources/providers.yml +10 -0
- eodag/rest/server.py +9 -7
- eodag/utils/__init__.py +7 -0
- eodag/utils/cache.py +68 -0
- {eodag-3.5.0.dist-info → eodag-3.6.0.dist-info}/METADATA +6 -5
- {eodag-3.5.0.dist-info → eodag-3.6.0.dist-info}/RECORD +21 -20
- {eodag-3.5.0.dist-info → eodag-3.6.0.dist-info}/WHEEL +0 -0
- {eodag-3.5.0.dist-info → eodag-3.6.0.dist-info}/entry_points.txt +0 -0
- {eodag-3.5.0.dist-info → eodag-3.6.0.dist-info}/licenses/LICENSE +0 -0
- {eodag-3.5.0.dist-info → eodag-3.6.0.dist-info}/top_level.txt +0 -0
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
# limitations under the License.
|
|
18
18
|
from __future__ import annotations
|
|
19
19
|
|
|
20
|
-
import functools
|
|
21
20
|
import hashlib
|
|
22
21
|
import logging
|
|
23
22
|
import re
|
|
@@ -61,6 +60,7 @@ from eodag.utils import (
|
|
|
61
60
|
get_geometry_from_various,
|
|
62
61
|
is_range_in_range,
|
|
63
62
|
)
|
|
63
|
+
from eodag.utils.cache import instance_cached_method
|
|
64
64
|
from eodag.utils.exceptions import DownloadError, NotAvailableError, ValidationError
|
|
65
65
|
from eodag.utils.requests import fetch_json
|
|
66
66
|
|
|
@@ -317,17 +317,17 @@ def append_time(input_date: date, time: Optional[str]) -> datetime:
|
|
|
317
317
|
|
|
318
318
|
|
|
319
319
|
def parse_date(
|
|
320
|
-
|
|
320
|
+
date: str, time: Optional[Union[str, list[str]]]
|
|
321
321
|
) -> tuple[datetime, datetime]:
|
|
322
322
|
"""Parses a date string in formats YYYY-MM-DD, YYYMMDD, solo or in start/end or start/to/end intervals."""
|
|
323
|
-
if "to" in
|
|
324
|
-
start_date_str, end_date_str =
|
|
325
|
-
elif "/" in
|
|
326
|
-
dates =
|
|
323
|
+
if "to" in date:
|
|
324
|
+
start_date_str, end_date_str = date.split("/to/")
|
|
325
|
+
elif "/" in date:
|
|
326
|
+
dates = date.split("/")
|
|
327
327
|
start_date_str = dates[0]
|
|
328
328
|
end_date_str = dates[-1]
|
|
329
329
|
else:
|
|
330
|
-
start_date_str = end_date_str =
|
|
330
|
+
start_date_str = end_date_str = date
|
|
331
331
|
|
|
332
332
|
# Update YYYYMMDD formatted dates
|
|
333
333
|
if re.match(r"^\d{8}$", start_date_str):
|
|
@@ -401,6 +401,8 @@ def ecmwf_temporal_to_eodag(
|
|
|
401
401
|
start = end = None
|
|
402
402
|
|
|
403
403
|
if date := params.get("date"):
|
|
404
|
+
if isinstance(date, list):
|
|
405
|
+
date = "/".join(date)
|
|
404
406
|
start, end = parse_date(date, params.get("time"))
|
|
405
407
|
|
|
406
408
|
elif year := (params.get("year") or params.get("hyear")):
|
|
@@ -1099,6 +1101,7 @@ class ECMWFSearch(PostJsonSearch):
|
|
|
1099
1101
|
|
|
1100
1102
|
return qp
|
|
1101
1103
|
|
|
1104
|
+
@instance_cached_method()
|
|
1102
1105
|
def _fetch_data(self, url: str) -> Any:
|
|
1103
1106
|
"""
|
|
1104
1107
|
fetches from a provider elements like constraints or forms.
|
|
@@ -1115,7 +1118,7 @@ class ECMWFSearch(PostJsonSearch):
|
|
|
1115
1118
|
else None
|
|
1116
1119
|
)
|
|
1117
1120
|
timeout = getattr(self.config, "timeout", DEFAULT_SEARCH_TIMEOUT)
|
|
1118
|
-
return
|
|
1121
|
+
return fetch_json(url, auth=auth, timeout=timeout)
|
|
1119
1122
|
|
|
1120
1123
|
def normalize_results(
|
|
1121
1124
|
self, results: RawSearchResult, **kwargs: Any
|
eodag/plugins/search/qssearch.py
CHANGED
|
@@ -1173,7 +1173,10 @@ class QueryStringSearch(Search):
|
|
|
1173
1173
|
|
|
1174
1174
|
collection = getattr(self.config, "collection", None)
|
|
1175
1175
|
if collection is None:
|
|
1176
|
-
collection =
|
|
1176
|
+
collection = (
|
|
1177
|
+
getattr(prep, "product_type_def_params", {}).get("collection")
|
|
1178
|
+
or product_type
|
|
1179
|
+
)
|
|
1177
1180
|
|
|
1178
1181
|
if collection is None:
|
|
1179
1182
|
return ()
|