eodag 3.10.0__py3-none-any.whl → 4.0.0a1__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 +378 -419
- eodag/api/product/__init__.py +3 -3
- eodag/api/product/_product.py +68 -40
- eodag/api/product/drivers/__init__.py +3 -5
- eodag/api/product/drivers/base.py +1 -18
- eodag/api/product/metadata_mapping.py +151 -215
- eodag/api/search_result.py +13 -7
- eodag/cli.py +72 -395
- eodag/config.py +46 -50
- eodag/plugins/apis/base.py +2 -2
- eodag/plugins/apis/ecmwf.py +20 -21
- eodag/plugins/apis/usgs.py +37 -33
- eodag/plugins/authentication/base.py +1 -3
- eodag/plugins/crunch/filter_date.py +3 -3
- eodag/plugins/crunch/filter_latest_intersect.py +2 -2
- eodag/plugins/crunch/filter_latest_tpl_name.py +1 -1
- eodag/plugins/download/aws.py +45 -41
- eodag/plugins/download/base.py +13 -14
- eodag/plugins/download/http.py +65 -65
- eodag/plugins/manager.py +28 -29
- eodag/plugins/search/__init__.py +3 -4
- eodag/plugins/search/base.py +128 -77
- eodag/plugins/search/build_search_result.py +105 -107
- eodag/plugins/search/cop_marine.py +44 -47
- eodag/plugins/search/csw.py +33 -33
- eodag/plugins/search/qssearch.py +335 -354
- eodag/plugins/search/stac_list_assets.py +1 -1
- eodag/plugins/search/static_stac_search.py +31 -31
- eodag/resources/{product_types.yml → collections.yml} +2353 -2429
- eodag/resources/ext_collections.json +1 -1
- eodag/resources/providers.yml +2427 -2719
- eodag/resources/stac_provider.yml +46 -90
- eodag/types/queryables.py +55 -91
- eodag/types/search_args.py +1 -1
- eodag/utils/__init__.py +94 -21
- eodag/utils/exceptions.py +6 -6
- eodag/utils/free_text_search.py +3 -3
- {eodag-3.10.0.dist-info → eodag-4.0.0a1.dist-info}/METADATA +10 -87
- eodag-4.0.0a1.dist-info/RECORD +92 -0
- {eodag-3.10.0.dist-info → eodag-4.0.0a1.dist-info}/entry_points.txt +0 -4
- eodag/plugins/authentication/oauth.py +0 -60
- eodag/plugins/download/creodias_s3.py +0 -71
- eodag/plugins/download/s3rest.py +0 -351
- eodag/plugins/search/data_request_search.py +0 -565
- eodag/resources/stac.yml +0 -294
- eodag/resources/stac_api.yml +0 -2105
- eodag/rest/__init__.py +0 -24
- eodag/rest/cache.py +0 -70
- eodag/rest/config.py +0 -67
- eodag/rest/constants.py +0 -26
- eodag/rest/core.py +0 -764
- eodag/rest/errors.py +0 -210
- eodag/rest/server.py +0 -604
- eodag/rest/server.wsgi +0 -6
- eodag/rest/stac.py +0 -1032
- eodag/rest/templates/README +0 -1
- eodag/rest/types/__init__.py +0 -18
- eodag/rest/types/collections_search.py +0 -44
- eodag/rest/types/eodag_search.py +0 -386
- eodag/rest/types/queryables.py +0 -174
- eodag/rest/types/stac_search.py +0 -272
- eodag/rest/utils/__init__.py +0 -207
- eodag/rest/utils/cql_evaluate.py +0 -119
- eodag/rest/utils/rfc3339.py +0 -64
- eodag-3.10.0.dist-info/RECORD +0 -116
- {eodag-3.10.0.dist-info → eodag-4.0.0a1.dist-info}/WHEEL +0 -0
- {eodag-3.10.0.dist-info → eodag-4.0.0a1.dist-info}/licenses/LICENSE +0 -0
- {eodag-3.10.0.dist-info → eodag-4.0.0a1.dist-info}/top_level.txt +0 -0
|
@@ -55,7 +55,7 @@ class StacListAssets(StacSearch):
|
|
|
55
55
|
"""``StacListAssets`` is an extension of :class:`~eodag.plugins.search.qssearch.StacSearch`.
|
|
56
56
|
|
|
57
57
|
It executes a Search on given STAC API endpoint and updates assets with content listed by the plugin using
|
|
58
|
-
``
|
|
58
|
+
``eodag:download_link`` :class:`~eodag.api.product._product.EOProduct` property.
|
|
59
59
|
|
|
60
60
|
:param provider: provider name
|
|
61
61
|
:param config: It has the same Search plugin configuration as :class:`~eodag.plugins.search.qssearch.StacSearch` and
|
|
@@ -69,12 +69,12 @@ class StaticStacSearch(StacSearch):
|
|
|
69
69
|
# prevent search parameters from being queried when they are known in the configuration or not
|
|
70
70
|
for param, mapping in config.metadata_mapping.items():
|
|
71
71
|
# only keep one queryable to allow the mock search request
|
|
72
|
-
if param != "
|
|
72
|
+
if param != "collection":
|
|
73
73
|
config.metadata_mapping[param] = get_metadata_path_value(mapping)
|
|
74
74
|
config.discover_metadata["auto_discovery"] = False
|
|
75
75
|
# there is no endpoint for fetching queryables with a static search
|
|
76
76
|
config.discover_queryables["fetch_url"] = None
|
|
77
|
-
config.discover_queryables["
|
|
77
|
+
config.discover_queryables["collection_fetch_url"] = None
|
|
78
78
|
|
|
79
79
|
super(StaticStacSearch, self).__init__(provider, config)
|
|
80
80
|
self.config.__dict__.setdefault("max_connections", 100)
|
|
@@ -85,19 +85,19 @@ class StaticStacSearch(StacSearch):
|
|
|
85
85
|
"total_items_nb_key_path", "$.null"
|
|
86
86
|
)
|
|
87
87
|
self.config.__dict__["pagination"].setdefault("max_items_per_page", -1)
|
|
88
|
-
# disable
|
|
88
|
+
# disable collections discovery by default (if endpoints equals to STAC API default)
|
|
89
89
|
if (
|
|
90
|
-
getattr(self.config, "
|
|
90
|
+
getattr(self.config, "discover_collections", {}).get("fetch_url")
|
|
91
91
|
== "{api_endpoint}/../collections"
|
|
92
92
|
):
|
|
93
|
-
self.config.
|
|
93
|
+
self.config.discover_collections = {}
|
|
94
94
|
|
|
95
|
-
def
|
|
96
|
-
"""Fetch
|
|
95
|
+
def discover_collections(self, **kwargs: Any) -> Optional[dict[str, Any]]:
|
|
96
|
+
"""Fetch collections list from a static STAC Catalog provider using `discover_collections` conf
|
|
97
97
|
|
|
98
|
-
:returns: configuration dict containing fetched
|
|
98
|
+
:returns: configuration dict containing fetched collections information
|
|
99
99
|
"""
|
|
100
|
-
unformatted_fetch_url = self.config.
|
|
100
|
+
unformatted_fetch_url = self.config.discover_collections.get("fetch_url")
|
|
101
101
|
if unformatted_fetch_url is None:
|
|
102
102
|
return None
|
|
103
103
|
fetch_url = unformatted_fetch_url.format(**self.config.__dict__)
|
|
@@ -113,13 +113,13 @@ class StaticStacSearch(StacSearch):
|
|
|
113
113
|
collections = [c for c in collections if c["id"] == kwargs["q"]]
|
|
114
114
|
collections_mock_response = {"collections": collections}
|
|
115
115
|
|
|
116
|
-
#
|
|
116
|
+
# discover_collections on mocked QueryStringSearch._request
|
|
117
117
|
with mock.patch(
|
|
118
118
|
"eodag.plugins.search.qssearch.QueryStringSearch._request",
|
|
119
119
|
autospec=True,
|
|
120
120
|
return_value=MockResponse(collections_mock_response, 200),
|
|
121
121
|
):
|
|
122
|
-
conf_update_dict = super(StaticStacSearch, self).
|
|
122
|
+
conf_update_dict = super(StaticStacSearch, self).discover_collections(
|
|
123
123
|
**kwargs
|
|
124
124
|
)
|
|
125
125
|
|
|
@@ -131,21 +131,21 @@ class StaticStacSearch(StacSearch):
|
|
|
131
131
|
"""Set static available queryables for :class:`~eodag.plugins.search.static_stac_search.StaticStacSearch`
|
|
132
132
|
search plugin
|
|
133
133
|
|
|
134
|
-
:param kwargs: additional filters for queryables (`
|
|
134
|
+
:param kwargs: additional filters for queryables (`collection` and other search
|
|
135
135
|
arguments)
|
|
136
136
|
:returns: queryable parameters dict
|
|
137
137
|
"""
|
|
138
138
|
return {
|
|
139
|
-
"
|
|
140
|
-
"
|
|
139
|
+
"collection": Queryables.get_with_default(
|
|
140
|
+
"collection", kwargs.get("collection")
|
|
141
141
|
),
|
|
142
142
|
"id": Queryables.get_with_default("id", kwargs.get("id")),
|
|
143
143
|
"start": Queryables.get_with_default(
|
|
144
|
-
"start", kwargs.get("start") or kwargs.get("
|
|
144
|
+
"start", kwargs.get("start") or kwargs.get("start_datetime")
|
|
145
145
|
),
|
|
146
146
|
"end": Queryables.get_with_default(
|
|
147
147
|
"end",
|
|
148
|
-
kwargs.get("end") or kwargs.get("
|
|
148
|
+
kwargs.get("end") or kwargs.get("end_datetime"),
|
|
149
149
|
),
|
|
150
150
|
"geom": Queryables.get_with_default(
|
|
151
151
|
"geom",
|
|
@@ -169,20 +169,20 @@ class StaticStacSearch(StacSearch):
|
|
|
169
169
|
):
|
|
170
170
|
return ([], 0) if prep.count else ([], None)
|
|
171
171
|
|
|
172
|
-
|
|
173
|
-
# provider
|
|
174
|
-
self.
|
|
175
|
-
self.
|
|
176
|
-
if
|
|
172
|
+
collection = kwargs.get("collection", prep.collection)
|
|
173
|
+
# provider collection specific conf
|
|
174
|
+
self.collection_def_params = (
|
|
175
|
+
self.get_collection_def_params(collection, format_variables=kwargs)
|
|
176
|
+
if collection is not None
|
|
177
177
|
else {}
|
|
178
178
|
)
|
|
179
179
|
|
|
180
|
-
for
|
|
180
|
+
for provider_collections in self.get_provider_collections(prep, **kwargs):
|
|
181
181
|
# skip empty collection if one is required in api_endpoint
|
|
182
|
-
if "{
|
|
182
|
+
if "{_collection}" in self.config.api_endpoint and not provider_collections:
|
|
183
183
|
continue
|
|
184
184
|
search_endpoint = self.config.api_endpoint.rstrip("/").format(
|
|
185
|
-
|
|
185
|
+
_collection=provider_collections
|
|
186
186
|
)
|
|
187
187
|
|
|
188
188
|
features = fetch_stac_items(
|
|
@@ -207,10 +207,10 @@ class StaticStacSearch(StacSearch):
|
|
|
207
207
|
# filter using query params
|
|
208
208
|
search_result = SearchResult(eo_products)
|
|
209
209
|
# Filter by date
|
|
210
|
-
if "
|
|
211
|
-
kwargs["start"] = kwargs.pop("
|
|
212
|
-
if "
|
|
213
|
-
kwargs["end"] = kwargs.pop("
|
|
210
|
+
if "start_datetime" in kwargs:
|
|
211
|
+
kwargs["start"] = kwargs.pop("start_datetime")
|
|
212
|
+
if "end_datetime" in kwargs:
|
|
213
|
+
kwargs["end"] = kwargs.pop("end_datetime")
|
|
214
214
|
if any(k in ["start", "end"] for k in kwargs.keys()):
|
|
215
215
|
search_result = search_result.crunch(
|
|
216
216
|
FilterDate({k: kwargs[k] for k in ["start", "end"] if k in kwargs})
|
|
@@ -223,17 +223,17 @@ class StaticStacSearch(StacSearch):
|
|
|
223
223
|
FilterOverlap({"intersects": True}), geometry=geometry
|
|
224
224
|
)
|
|
225
225
|
# Filter by cloudCover
|
|
226
|
-
if "
|
|
226
|
+
if "eo:cloud_cover" in kwargs.keys():
|
|
227
227
|
search_result = search_result.crunch(
|
|
228
228
|
FilterProperty(
|
|
229
|
-
{"
|
|
229
|
+
{"eo:cloud_cover": kwargs.pop("eo:cloud_cover"), "operator": "lt"}
|
|
230
230
|
)
|
|
231
231
|
)
|
|
232
232
|
# Filter by other properties
|
|
233
233
|
skip_eodag_internal_parameters = [
|
|
234
234
|
"auth",
|
|
235
235
|
"raise_errors",
|
|
236
|
-
"
|
|
236
|
+
"collection",
|
|
237
237
|
"locations",
|
|
238
238
|
"start",
|
|
239
239
|
"end",
|