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.
Files changed (68) hide show
  1. eodag/api/core.py +378 -419
  2. eodag/api/product/__init__.py +3 -3
  3. eodag/api/product/_product.py +68 -40
  4. eodag/api/product/drivers/__init__.py +3 -5
  5. eodag/api/product/drivers/base.py +1 -18
  6. eodag/api/product/metadata_mapping.py +151 -215
  7. eodag/api/search_result.py +13 -7
  8. eodag/cli.py +72 -395
  9. eodag/config.py +46 -50
  10. eodag/plugins/apis/base.py +2 -2
  11. eodag/plugins/apis/ecmwf.py +20 -21
  12. eodag/plugins/apis/usgs.py +37 -33
  13. eodag/plugins/authentication/base.py +1 -3
  14. eodag/plugins/crunch/filter_date.py +3 -3
  15. eodag/plugins/crunch/filter_latest_intersect.py +2 -2
  16. eodag/plugins/crunch/filter_latest_tpl_name.py +1 -1
  17. eodag/plugins/download/aws.py +45 -41
  18. eodag/plugins/download/base.py +13 -14
  19. eodag/plugins/download/http.py +65 -65
  20. eodag/plugins/manager.py +28 -29
  21. eodag/plugins/search/__init__.py +3 -4
  22. eodag/plugins/search/base.py +128 -77
  23. eodag/plugins/search/build_search_result.py +105 -107
  24. eodag/plugins/search/cop_marine.py +44 -47
  25. eodag/plugins/search/csw.py +33 -33
  26. eodag/plugins/search/qssearch.py +335 -354
  27. eodag/plugins/search/stac_list_assets.py +1 -1
  28. eodag/plugins/search/static_stac_search.py +31 -31
  29. eodag/resources/{product_types.yml → collections.yml} +2353 -2429
  30. eodag/resources/ext_collections.json +1 -1
  31. eodag/resources/providers.yml +2427 -2719
  32. eodag/resources/stac_provider.yml +46 -90
  33. eodag/types/queryables.py +55 -91
  34. eodag/types/search_args.py +1 -1
  35. eodag/utils/__init__.py +94 -21
  36. eodag/utils/exceptions.py +6 -6
  37. eodag/utils/free_text_search.py +3 -3
  38. {eodag-3.10.0.dist-info → eodag-4.0.0a1.dist-info}/METADATA +10 -87
  39. eodag-4.0.0a1.dist-info/RECORD +92 -0
  40. {eodag-3.10.0.dist-info → eodag-4.0.0a1.dist-info}/entry_points.txt +0 -4
  41. eodag/plugins/authentication/oauth.py +0 -60
  42. eodag/plugins/download/creodias_s3.py +0 -71
  43. eodag/plugins/download/s3rest.py +0 -351
  44. eodag/plugins/search/data_request_search.py +0 -565
  45. eodag/resources/stac.yml +0 -294
  46. eodag/resources/stac_api.yml +0 -2105
  47. eodag/rest/__init__.py +0 -24
  48. eodag/rest/cache.py +0 -70
  49. eodag/rest/config.py +0 -67
  50. eodag/rest/constants.py +0 -26
  51. eodag/rest/core.py +0 -764
  52. eodag/rest/errors.py +0 -210
  53. eodag/rest/server.py +0 -604
  54. eodag/rest/server.wsgi +0 -6
  55. eodag/rest/stac.py +0 -1032
  56. eodag/rest/templates/README +0 -1
  57. eodag/rest/types/__init__.py +0 -18
  58. eodag/rest/types/collections_search.py +0 -44
  59. eodag/rest/types/eodag_search.py +0 -386
  60. eodag/rest/types/queryables.py +0 -174
  61. eodag/rest/types/stac_search.py +0 -272
  62. eodag/rest/utils/__init__.py +0 -207
  63. eodag/rest/utils/cql_evaluate.py +0 -119
  64. eodag/rest/utils/rfc3339.py +0 -64
  65. eodag-3.10.0.dist-info/RECORD +0 -116
  66. {eodag-3.10.0.dist-info → eodag-4.0.0a1.dist-info}/WHEEL +0 -0
  67. {eodag-3.10.0.dist-info → eodag-4.0.0a1.dist-info}/licenses/LICENSE +0 -0
  68. {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
- ``downloadLink`` :class:`~eodag.api.product._product.EOProduct` property.
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 != "productType":
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["product_type_fetch_url"] = None
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 product types discovery by default (if endpoints equals to STAC API default)
88
+ # disable collections discovery by default (if endpoints equals to STAC API default)
89
89
  if (
90
- getattr(self.config, "discover_product_types", {}).get("fetch_url")
90
+ getattr(self.config, "discover_collections", {}).get("fetch_url")
91
91
  == "{api_endpoint}/../collections"
92
92
  ):
93
- self.config.discover_product_types = {}
93
+ self.config.discover_collections = {}
94
94
 
95
- def discover_product_types(self, **kwargs: Any) -> Optional[dict[str, Any]]:
96
- """Fetch product types list from a static STAC Catalog provider using `discover_product_types` conf
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 product types information
98
+ :returns: configuration dict containing fetched collections information
99
99
  """
100
- unformatted_fetch_url = self.config.discover_product_types.get("fetch_url")
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
- # discover_product_types on mocked QueryStringSearch._request
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).discover_product_types(
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 (`productType` and other search
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
- "productType": Queryables.get_with_default(
140
- "productType", kwargs.get("productType")
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("startTimeFromAscendingNode")
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("completionTimeFromAscendingNode"),
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
- product_type = kwargs.get("productType", prep.product_type)
173
- # provider product type specific conf
174
- self.product_type_def_params = (
175
- self.get_product_type_def_params(product_type, format_variables=kwargs)
176
- if product_type is not None
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 collection in self.get_collections(prep, **kwargs):
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 "{collection}" in self.config.api_endpoint and not collection:
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
- collection=collection
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 "startTimeFromAscendingNode" in kwargs:
211
- kwargs["start"] = kwargs.pop("startTimeFromAscendingNode")
212
- if "completionTimeFromAscendingNode" in kwargs:
213
- kwargs["end"] = kwargs.pop("completionTimeFromAscendingNode")
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 "cloudCover" in kwargs.keys():
226
+ if "eo:cloud_cover" in kwargs.keys():
227
227
  search_result = search_result.crunch(
228
228
  FilterProperty(
229
- {"cloudCover": kwargs.pop("cloudCover"), "operator": "lt"}
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
- "productType",
236
+ "collection",
237
237
  "locations",
238
238
  "start",
239
239
  "end",