eodag 3.0.1__py3-none-any.whl → 3.1.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 +174 -138
- eodag/api/product/_assets.py +44 -15
- eodag/api/product/_product.py +58 -47
- eodag/api/product/drivers/__init__.py +81 -4
- eodag/api/product/drivers/base.py +65 -4
- eodag/api/product/drivers/generic.py +65 -0
- eodag/api/product/drivers/sentinel1.py +97 -0
- eodag/api/product/drivers/sentinel2.py +95 -0
- eodag/api/product/metadata_mapping.py +117 -90
- eodag/api/search_result.py +13 -23
- eodag/cli.py +26 -5
- eodag/config.py +86 -92
- eodag/plugins/apis/base.py +1 -1
- eodag/plugins/apis/ecmwf.py +42 -22
- eodag/plugins/apis/usgs.py +17 -16
- eodag/plugins/authentication/aws_auth.py +16 -13
- eodag/plugins/authentication/base.py +5 -3
- eodag/plugins/authentication/header.py +3 -3
- eodag/plugins/authentication/keycloak.py +4 -4
- eodag/plugins/authentication/oauth.py +7 -3
- eodag/plugins/authentication/openid_connect.py +22 -16
- eodag/plugins/authentication/sas_auth.py +4 -4
- eodag/plugins/authentication/token.py +41 -10
- eodag/plugins/authentication/token_exchange.py +1 -1
- eodag/plugins/base.py +4 -4
- eodag/plugins/crunch/base.py +4 -4
- eodag/plugins/crunch/filter_date.py +4 -4
- eodag/plugins/crunch/filter_latest_intersect.py +6 -6
- eodag/plugins/crunch/filter_latest_tpl_name.py +7 -7
- eodag/plugins/crunch/filter_overlap.py +4 -4
- eodag/plugins/crunch/filter_property.py +6 -7
- eodag/plugins/download/aws.py +146 -87
- eodag/plugins/download/base.py +38 -56
- eodag/plugins/download/creodias_s3.py +29 -0
- eodag/plugins/download/http.py +173 -183
- eodag/plugins/download/s3rest.py +10 -11
- eodag/plugins/manager.py +10 -20
- eodag/plugins/search/__init__.py +6 -5
- eodag/plugins/search/base.py +90 -46
- eodag/plugins/search/build_search_result.py +1048 -361
- eodag/plugins/search/cop_marine.py +22 -12
- eodag/plugins/search/creodias_s3.py +9 -73
- eodag/plugins/search/csw.py +11 -11
- eodag/plugins/search/data_request_search.py +19 -18
- eodag/plugins/search/qssearch.py +99 -258
- eodag/plugins/search/stac_list_assets.py +85 -0
- eodag/plugins/search/static_stac_search.py +4 -4
- eodag/resources/ext_product_types.json +1 -1
- eodag/resources/product_types.yml +1134 -325
- eodag/resources/providers.yml +906 -2006
- eodag/resources/stac_api.yml +2 -2
- eodag/resources/user_conf_template.yml +10 -9
- eodag/rest/cache.py +2 -2
- eodag/rest/config.py +3 -3
- eodag/rest/core.py +112 -82
- eodag/rest/errors.py +5 -5
- eodag/rest/server.py +33 -14
- eodag/rest/stac.py +41 -38
- eodag/rest/types/collections_search.py +3 -3
- eodag/rest/types/eodag_search.py +29 -23
- eodag/rest/types/queryables.py +42 -31
- eodag/rest/types/stac_search.py +15 -25
- eodag/rest/utils/__init__.py +14 -21
- eodag/rest/utils/cql_evaluate.py +6 -6
- eodag/rest/utils/rfc3339.py +2 -2
- eodag/types/__init__.py +141 -32
- eodag/types/bbox.py +2 -2
- eodag/types/download_args.py +3 -3
- eodag/types/queryables.py +183 -72
- eodag/types/search_args.py +4 -4
- eodag/types/whoosh.py +127 -3
- eodag/utils/__init__.py +153 -51
- eodag/utils/exceptions.py +28 -21
- eodag/utils/import_system.py +2 -2
- eodag/utils/repr.py +65 -6
- eodag/utils/requests.py +13 -13
- eodag/utils/rest.py +2 -2
- eodag/utils/s3.py +231 -0
- eodag/utils/stac_reader.py +10 -10
- {eodag-3.0.1.dist-info → eodag-3.1.0.dist-info}/METADATA +77 -76
- eodag-3.1.0.dist-info/RECORD +113 -0
- {eodag-3.0.1.dist-info → eodag-3.1.0.dist-info}/WHEEL +1 -1
- {eodag-3.0.1.dist-info → eodag-3.1.0.dist-info}/entry_points.txt +4 -2
- eodag/utils/constraints.py +0 -244
- eodag-3.0.1.dist-info/RECORD +0 -109
- {eodag-3.0.1.dist-info → eodag-3.1.0.dist-info}/LICENSE +0 -0
- {eodag-3.0.1.dist-info → eodag-3.1.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright 2024, CS GROUP - France, https://www.csgroup.eu/
|
|
3
|
+
#
|
|
4
|
+
# This file is part of EODAG project
|
|
5
|
+
# https://www.github.com/CS-SI/EODAG
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
import logging
|
|
19
|
+
from types import MethodType
|
|
20
|
+
from typing import Any, List
|
|
21
|
+
|
|
22
|
+
from botocore.exceptions import BotoCoreError
|
|
23
|
+
|
|
24
|
+
from eodag.api.product import EOProduct # type: ignore
|
|
25
|
+
from eodag.api.search_result import RawSearchResult
|
|
26
|
+
from eodag.plugins.search.qssearch import StacSearch
|
|
27
|
+
from eodag.utils.exceptions import RequestError
|
|
28
|
+
from eodag.utils.s3 import update_assets_from_s3
|
|
29
|
+
|
|
30
|
+
logger = logging.getLogger("eodag.search.stac_list_assets")
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def patched_register_downloader(self, downloader, authenticator):
|
|
34
|
+
"""Add the download information to the product.
|
|
35
|
+
|
|
36
|
+
:param self: product to which information should be added
|
|
37
|
+
:param downloader: The download method that it can use
|
|
38
|
+
:class:`~eodag.plugins.download.base.Download` or
|
|
39
|
+
:class:`~eodag.plugins.api.base.Api`
|
|
40
|
+
:param authenticator: The authentication method needed to perform the download
|
|
41
|
+
:class:`~eodag.plugins.authentication.base.Authentication`
|
|
42
|
+
"""
|
|
43
|
+
# register downloader
|
|
44
|
+
self.register_downloader_only(downloader, authenticator)
|
|
45
|
+
# and also update assets
|
|
46
|
+
try:
|
|
47
|
+
update_assets_from_s3(
|
|
48
|
+
self, authenticator, getattr(downloader.config, "s3_endpoint", None)
|
|
49
|
+
)
|
|
50
|
+
except BotoCoreError as e:
|
|
51
|
+
raise RequestError.from_error(e, "could not update assets") from e
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class StacListAssets(StacSearch):
|
|
55
|
+
"""``StacListAssets`` is an extension of :class:`~eodag.plugins.search.qssearch.StacSearch`.
|
|
56
|
+
|
|
57
|
+
It executes a Search on given STAC API endpoint and updates assets with content listed by the plugin using
|
|
58
|
+
``downloadLink`` :class:`~eodag.api.product._product.EOProduct` property.
|
|
59
|
+
|
|
60
|
+
:param provider: provider name
|
|
61
|
+
:param config: It has the same Search plugin configuration as :class:`~eodag.plugins.search.qssearch.StacSearch` and
|
|
62
|
+
one additional parameter:
|
|
63
|
+
|
|
64
|
+
* :attr:`~eodag.config.PluginConfig.s3_endpoint` (``str``): s3 endpoint if not hosted on AWS
|
|
65
|
+
"""
|
|
66
|
+
|
|
67
|
+
def __init__(self, provider, config):
|
|
68
|
+
super(StacSearch, self).__init__(provider, config)
|
|
69
|
+
|
|
70
|
+
def normalize_results(
|
|
71
|
+
self, results: RawSearchResult, **kwargs: Any
|
|
72
|
+
) -> List[EOProduct]:
|
|
73
|
+
"""Build EOProducts from provider results"""
|
|
74
|
+
|
|
75
|
+
products = super(StacSearch, self).normalize_results(results, **kwargs)
|
|
76
|
+
|
|
77
|
+
for product in products:
|
|
78
|
+
# backup original register_downloader to register_downloader_only
|
|
79
|
+
product.register_downloader_only = product.register_downloader
|
|
80
|
+
# patched register_downloader that will also update assets
|
|
81
|
+
product.register_downloader = MethodType(
|
|
82
|
+
patched_register_downloader, product
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
return products
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
from __future__ import annotations
|
|
19
19
|
|
|
20
20
|
import logging
|
|
21
|
-
from typing import TYPE_CHECKING, Any,
|
|
21
|
+
from typing import TYPE_CHECKING, Any, Optional
|
|
22
22
|
from unittest import mock
|
|
23
23
|
|
|
24
24
|
import geojson
|
|
@@ -90,7 +90,7 @@ class StaticStacSearch(StacSearch):
|
|
|
90
90
|
):
|
|
91
91
|
self.config.discover_product_types = {}
|
|
92
92
|
|
|
93
|
-
def discover_product_types(self, **kwargs: Any) -> Optional[
|
|
93
|
+
def discover_product_types(self, **kwargs: Any) -> Optional[dict[str, Any]]:
|
|
94
94
|
"""Fetch product types list from a static STAC Catalog provider using `discover_product_types` conf
|
|
95
95
|
|
|
96
96
|
:returns: configuration dict containing fetched product types information
|
|
@@ -127,7 +127,7 @@ class StaticStacSearch(StacSearch):
|
|
|
127
127
|
self,
|
|
128
128
|
prep: PreparedSearch = PreparedSearch(),
|
|
129
129
|
**kwargs: Any,
|
|
130
|
-
) ->
|
|
130
|
+
) -> tuple[list[EOProduct], Optional[int]]:
|
|
131
131
|
"""Perform a search on a static STAC Catalog"""
|
|
132
132
|
|
|
133
133
|
# only return 1 page if pagination is disabled
|
|
@@ -142,7 +142,7 @@ class StaticStacSearch(StacSearch):
|
|
|
142
142
|
product_type = kwargs.get("productType", prep.product_type)
|
|
143
143
|
# provider product type specific conf
|
|
144
144
|
self.product_type_def_params = (
|
|
145
|
-
self.get_product_type_def_params(product_type,
|
|
145
|
+
self.get_product_type_def_params(product_type, format_variables=kwargs)
|
|
146
146
|
if product_type is not None
|
|
147
147
|
else {}
|
|
148
148
|
)
|