eodag 4.0.0a1__py3-none-any.whl → 4.0.0a3__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 (37) hide show
  1. eodag/__init__.py +6 -1
  2. eodag/api/collection.py +354 -0
  3. eodag/api/core.py +324 -303
  4. eodag/api/product/_product.py +15 -29
  5. eodag/api/product/drivers/__init__.py +2 -42
  6. eodag/api/product/drivers/base.py +0 -11
  7. eodag/api/product/metadata_mapping.py +34 -5
  8. eodag/api/search_result.py +144 -9
  9. eodag/cli.py +18 -15
  10. eodag/config.py +37 -3
  11. eodag/plugins/apis/ecmwf.py +16 -4
  12. eodag/plugins/apis/usgs.py +18 -7
  13. eodag/plugins/crunch/filter_latest_intersect.py +1 -0
  14. eodag/plugins/crunch/filter_overlap.py +3 -7
  15. eodag/plugins/search/__init__.py +3 -0
  16. eodag/plugins/search/base.py +6 -6
  17. eodag/plugins/search/build_search_result.py +157 -56
  18. eodag/plugins/search/cop_marine.py +48 -8
  19. eodag/plugins/search/csw.py +18 -8
  20. eodag/plugins/search/qssearch.py +331 -88
  21. eodag/plugins/search/static_stac_search.py +11 -12
  22. eodag/resources/collections.yml +610 -348
  23. eodag/resources/ext_collections.json +1 -1
  24. eodag/resources/ext_product_types.json +1 -1
  25. eodag/resources/providers.yml +334 -62
  26. eodag/resources/stac_provider.yml +4 -2
  27. eodag/resources/user_conf_template.yml +9 -0
  28. eodag/types/__init__.py +2 -0
  29. eodag/types/queryables.py +16 -0
  30. eodag/utils/__init__.py +47 -2
  31. eodag/utils/repr.py +2 -0
  32. {eodag-4.0.0a1.dist-info → eodag-4.0.0a3.dist-info}/METADATA +4 -2
  33. {eodag-4.0.0a1.dist-info → eodag-4.0.0a3.dist-info}/RECORD +37 -36
  34. {eodag-4.0.0a1.dist-info → eodag-4.0.0a3.dist-info}/WHEEL +0 -0
  35. {eodag-4.0.0a1.dist-info → eodag-4.0.0a3.dist-info}/entry_points.txt +0 -0
  36. {eodag-4.0.0a1.dist-info → eodag-4.0.0a3.dist-info}/licenses/LICENSE +0 -0
  37. {eodag-4.0.0a1.dist-info → eodag-4.0.0a3.dist-info}/top_level.txt +0 -0
@@ -36,7 +36,6 @@ from eodag.utils import HTTP_REQ_TIMEOUT, MockResponse
36
36
  from eodag.utils.stac_reader import fetch_stac_collections, fetch_stac_items
37
37
 
38
38
  if TYPE_CHECKING:
39
- from eodag.api.product import EOProduct
40
39
  from eodag.config import PluginConfig
41
40
 
42
41
 
@@ -102,6 +101,8 @@ class StaticStacSearch(StacSearch):
102
101
  return None
103
102
  fetch_url = unformatted_fetch_url.format(**self.config.__dict__)
104
103
 
104
+ logger.info(f"Fetching collections: {fetch_url}")
105
+
105
106
  collections = fetch_stac_collections(
106
107
  fetch_url,
107
108
  collection=kwargs.get("q"),
@@ -157,7 +158,7 @@ class StaticStacSearch(StacSearch):
157
158
  self,
158
159
  prep: PreparedSearch = PreparedSearch(),
159
160
  **kwargs: Any,
160
- ) -> tuple[list[EOProduct], Optional[int]]:
161
+ ) -> SearchResult:
161
162
  """Perform a search on a static STAC Catalog"""
162
163
 
163
164
  # only return 1 page if pagination is disabled
@@ -167,7 +168,10 @@ class StaticStacSearch(StacSearch):
167
168
  and prep.items_per_page is not None
168
169
  and prep.items_per_page <= 0
169
170
  ):
170
- return ([], 0) if prep.count else ([], None)
171
+ result = SearchResult([])
172
+ if prep.count:
173
+ result.number_matched = 0
174
+ return result
171
175
 
172
176
  collection = kwargs.get("collection", prep.collection)
173
177
  # provider collection specific conf
@@ -201,11 +205,9 @@ class StaticStacSearch(StacSearch):
201
205
  autospec=True,
202
206
  return_value=MockResponse(feature_collection, 200),
203
207
  ):
204
- eo_products, _ = super(StaticStacSearch, self).query(
208
+ search_result = super(StaticStacSearch, self).query(
205
209
  PreparedSearch(items_per_page=nb_features, page=1, count=True), **kwargs
206
210
  )
207
- # filter using query params
208
- search_result = SearchResult(eo_products)
209
211
  # Filter by date
210
212
  if "start_datetime" in kwargs:
211
213
  kwargs["start"] = kwargs.pop("start_datetime")
@@ -244,9 +246,6 @@ class StaticStacSearch(StacSearch):
244
246
  search_result = search_result.crunch(
245
247
  FilterProperty({property_key: property_value, "operator": "eq"})
246
248
  )
247
-
248
- return (
249
- (search_result.data, len(search_result))
250
- if prep.count
251
- else (search_result.data, None)
252
- )
249
+ if prep.count:
250
+ search_result.number_matched = len(search_result.data)
251
+ return search_result