eodag 3.0.0b1__py3-none-any.whl → 3.0.0b3__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 (66) hide show
  1. eodag/__init__.py +6 -8
  2. eodag/api/core.py +119 -171
  3. eodag/api/product/__init__.py +10 -4
  4. eodag/api/product/_assets.py +52 -14
  5. eodag/api/product/_product.py +59 -30
  6. eodag/api/product/drivers/__init__.py +7 -2
  7. eodag/api/product/drivers/base.py +0 -3
  8. eodag/api/product/metadata_mapping.py +0 -28
  9. eodag/api/search_result.py +31 -9
  10. eodag/config.py +45 -41
  11. eodag/plugins/apis/base.py +3 -3
  12. eodag/plugins/apis/ecmwf.py +2 -3
  13. eodag/plugins/apis/usgs.py +43 -14
  14. eodag/plugins/authentication/aws_auth.py +11 -2
  15. eodag/plugins/authentication/openid_connect.py +5 -4
  16. eodag/plugins/authentication/token.py +2 -1
  17. eodag/plugins/crunch/base.py +3 -1
  18. eodag/plugins/crunch/filter_date.py +3 -9
  19. eodag/plugins/crunch/filter_latest_intersect.py +0 -3
  20. eodag/plugins/crunch/filter_latest_tpl_name.py +1 -4
  21. eodag/plugins/crunch/filter_overlap.py +4 -8
  22. eodag/plugins/crunch/filter_property.py +5 -11
  23. eodag/plugins/download/aws.py +46 -78
  24. eodag/plugins/download/base.py +27 -68
  25. eodag/plugins/download/http.py +48 -57
  26. eodag/plugins/download/s3rest.py +17 -25
  27. eodag/plugins/manager.py +6 -18
  28. eodag/plugins/search/__init__.py +9 -9
  29. eodag/plugins/search/base.py +7 -26
  30. eodag/plugins/search/build_search_result.py +0 -13
  31. eodag/plugins/search/cop_marine.py +1 -3
  32. eodag/plugins/search/creodias_s3.py +0 -3
  33. eodag/plugins/search/data_request_search.py +10 -5
  34. eodag/plugins/search/qssearch.py +95 -53
  35. eodag/plugins/search/static_stac_search.py +6 -3
  36. eodag/resources/ext_product_types.json +1 -1
  37. eodag/resources/product_types.yml +24 -0
  38. eodag/resources/providers.yml +198 -154
  39. eodag/resources/user_conf_template.yml +27 -27
  40. eodag/rest/core.py +11 -43
  41. eodag/rest/server.py +1 -6
  42. eodag/rest/stac.py +13 -87
  43. eodag/rest/types/eodag_search.py +4 -7
  44. eodag/rest/types/queryables.py +4 -12
  45. eodag/rest/types/stac_search.py +7 -11
  46. eodag/rest/utils/rfc3339.py +0 -1
  47. eodag/types/__init__.py +9 -3
  48. eodag/types/download_args.py +14 -5
  49. eodag/types/search_args.py +7 -8
  50. eodag/types/whoosh.py +0 -2
  51. eodag/utils/__init__.py +20 -79
  52. eodag/utils/constraints.py +0 -8
  53. eodag/utils/import_system.py +0 -4
  54. eodag/utils/logging.py +0 -3
  55. eodag/utils/notebook.py +4 -4
  56. eodag/utils/repr.py +113 -0
  57. eodag/utils/requests.py +12 -20
  58. eodag/utils/rest.py +0 -4
  59. eodag/utils/stac_reader.py +2 -14
  60. {eodag-3.0.0b1.dist-info → eodag-3.0.0b3.dist-info}/METADATA +33 -14
  61. eodag-3.0.0b3.dist-info/RECORD +110 -0
  62. {eodag-3.0.0b1.dist-info → eodag-3.0.0b3.dist-info}/WHEEL +1 -1
  63. eodag-3.0.0b1.dist-info/RECORD +0 -109
  64. {eodag-3.0.0b1.dist-info → eodag-3.0.0b3.dist-info}/LICENSE +0 -0
  65. {eodag-3.0.0b1.dist-info → eodag-3.0.0b3.dist-info}/entry_points.txt +0 -0
  66. {eodag-3.0.0b1.dist-info → eodag-3.0.0b3.dist-info}/top_level.txt +0 -0
@@ -20,7 +20,7 @@ peps:
20
20
  search: # Search parameters configuration
21
21
  download:
22
22
  extract: # whether to extract the downloaded products, only applies to archived products (true or false, Default: true).
23
- outputs_prefix: # where to store downloaded products, as an absolute file path (Default: local temporary directory)
23
+ output_dir: # where to store downloaded products, as an absolute file path (Default: local temporary directory)
24
24
  dl_url_params: # additional parameters to pass over to the download url as an url parameter
25
25
  delete_archive: # whether to delete the downloaded archives (true or false, Default: true).
26
26
  auth:
@@ -32,7 +32,7 @@ theia:
32
32
  search: # Search parameters configuration
33
33
  download:
34
34
  extract:
35
- outputs_prefix:
35
+ output_dir:
36
36
  dl_url_params:
37
37
  auth:
38
38
  credentials:
@@ -42,7 +42,7 @@ usgs:
42
42
  priority: # Lower value means lower priority (Default: 0)
43
43
  api:
44
44
  extract:
45
- outputs_prefix:
45
+ output_dir:
46
46
  dl_url_params:
47
47
  product_location_scheme:
48
48
  credentials:
@@ -58,13 +58,13 @@ aws_eos:
58
58
  aws_secret_access_key:
59
59
  aws_profile:
60
60
  download:
61
- outputs_prefix:
61
+ output_dir:
62
62
  creodias:
63
63
  priority: # Lower value means lower priority (Default: 0)
64
64
  search: # Search parameters configuration
65
65
  download:
66
66
  extract:
67
- outputs_prefix:
67
+ output_dir:
68
68
  auth:
69
69
  credentials:
70
70
  username:
@@ -75,7 +75,7 @@ onda:
75
75
  search: # Search parameters configuration
76
76
  download:
77
77
  extract:
78
- outputs_prefix:
78
+ output_dir:
79
79
  auth:
80
80
  credentials:
81
81
  username:
@@ -89,7 +89,7 @@ astraea_eod:
89
89
  aws_secret_access_key:
90
90
  aws_profile:
91
91
  download:
92
- outputs_prefix:
92
+ output_dir:
93
93
  usgs_satapi_aws:
94
94
  priority: # Lower value means lower priority (Default: 0)
95
95
  search: # Search parameters configuration
@@ -99,7 +99,7 @@ usgs_satapi_aws:
99
99
  aws_secret_access_key:
100
100
  aws_profile:
101
101
  download:
102
- outputs_prefix:
102
+ output_dir:
103
103
  earth_search:
104
104
  priority: # Lower value means lower priority (Default: 0)
105
105
  search: # Search parameters configuration
@@ -109,12 +109,12 @@ earth_search:
109
109
  aws_secret_access_key:
110
110
  aws_profile:
111
111
  download:
112
- outputs_prefix:
112
+ output_dir:
113
113
  earth_search_cog:
114
114
  priority: # Lower value means lower priority (Default: 0)
115
115
  search: # Search parameters configuration
116
116
  download:
117
- outputs_prefix:
117
+ output_dir:
118
118
  earth_search_gcs:
119
119
  priority: # Lower value means lower priority (Default: 0)
120
120
  search: # Search parameters configuration
@@ -123,11 +123,11 @@ earth_search_gcs:
123
123
  aws_access_key_id:
124
124
  aws_secret_access_key:
125
125
  download:
126
- outputs_prefix:
126
+ output_dir:
127
127
  ecmwf:
128
128
  priority: # Lower value means lower priority (Default: 0)
129
129
  api:
130
- outputs_prefix:
130
+ output_dir:
131
131
  credentials:
132
132
  username:
133
133
  password:
@@ -136,7 +136,7 @@ cop_ads:
136
136
  search: # Search parameters configuration
137
137
  download:
138
138
  extract:
139
- outputs_prefix:
139
+ output_dir:
140
140
  auth:
141
141
  credentials:
142
142
  username:
@@ -146,7 +146,7 @@ cop_cds:
146
146
  search: # Search parameters configuration
147
147
  download:
148
148
  extract:
149
- outputs_prefix:
149
+ output_dir:
150
150
  auth:
151
151
  credentials:
152
152
  username:
@@ -156,7 +156,7 @@ sara:
156
156
  search: # Search parameters configuration
157
157
  download:
158
158
  extract:
159
- outputs_prefix:
159
+ output_dir:
160
160
  delete_archive:
161
161
  auth:
162
162
  credentials:
@@ -169,13 +169,13 @@ meteoblue:
169
169
  credentials:
170
170
  apikey:
171
171
  download:
172
- outputs_prefix:
172
+ output_dir:
173
173
  cop_dataspace:
174
174
  priority: # Lower value means lower priority (Default: 0)
175
175
  search: # Search parameters configuration
176
176
  download:
177
177
  extract:
178
- outputs_prefix:
178
+ output_dir:
179
179
  auth:
180
180
  credentials:
181
181
  username:
@@ -187,7 +187,7 @@ planetary_computer:
187
187
  credentials:
188
188
  apikey:
189
189
  download:
190
- outputs_prefix:
190
+ output_dir:
191
191
  hydroweb_next:
192
192
  priority: # Lower value means lower priority (Default: 0)
193
193
  search: # Search parameters configuration
@@ -195,12 +195,12 @@ hydroweb_next:
195
195
  credentials:
196
196
  apikey:
197
197
  download:
198
- outputs_prefix:
198
+ output_dir:
199
199
  wekeo:
200
200
  priority: # Lower value means lower priority (Default: 0)
201
201
  search: # Search parameters configuration
202
202
  download:
203
- outputs_prefix:
203
+ output_dir:
204
204
  auth:
205
205
  credentials:
206
206
  username:
@@ -209,7 +209,7 @@ wekeo_cmems:
209
209
  priority: # Lower value means lower priority (Default: 0)
210
210
  search:
211
211
  download:
212
- outputs_prefix:
212
+ output_dir:
213
213
  auth:
214
214
  credentials:
215
215
  username:
@@ -218,7 +218,7 @@ creodias_s3:
218
218
  priority: # Lower value means lower priority (Default: 0)
219
219
  search: # Search parameters configuration
220
220
  download:
221
- outputs_prefix:
221
+ output_dir:
222
222
  auth:
223
223
  credentials:
224
224
  aws_access_key_id:
@@ -227,7 +227,7 @@ dedt_lumi:
227
227
  priority: # Lower value means lower priority (Default: 0)
228
228
  search:
229
229
  download:
230
- outputs_prefix:
230
+ output_dir:
231
231
  auth:
232
232
  credentials:
233
233
  username:
@@ -236,7 +236,7 @@ dedl:
236
236
  priority: # Lower value means lower priority (Default: 0)
237
237
  search: # Search parameters configuration
238
238
  download:
239
- outputs_prefix:
239
+ output_dir:
240
240
  auth:
241
241
  credentials:
242
242
  username:
@@ -244,16 +244,16 @@ dedl:
244
244
  eumetsat_ds:
245
245
  priority: # Lower value means lower priority (Default: 0)
246
246
  search: # Search parameters configuration
247
- outputs_prefix:
247
+ output_dir:
248
248
  auth:
249
249
  credentials:
250
250
  username:
251
251
  password:
252
252
  download:
253
- outputs_prefix:
253
+ output_dir:
254
254
  cop_marine:
255
255
  priority: # Lower value means lower priority (Default: 0)
256
256
  search: # Search parameters configuration
257
257
  download:
258
258
  extract:
259
- outputs_prefix:
259
+ output_dir:
eodag/rest/core.py CHANGED
@@ -80,7 +80,7 @@ from eodag.utils.exceptions import (
80
80
  )
81
81
 
82
82
  if TYPE_CHECKING:
83
- from typing import Any, Callable, Dict, List, Optional, Tuple, Union
83
+ from typing import Any, Dict, List, Optional, Tuple, Union
84
84
 
85
85
  from fastapi import Request
86
86
  from requests.auth import AuthBase
@@ -105,9 +105,7 @@ def get_home_page_content(base_url: str, ipp: Optional[int] = None) -> str:
105
105
  """Compute eodag service home page content
106
106
 
107
107
  :param base_url: The service root URL
108
- :type base_url: str
109
108
  :param ipp: (optional) Items per page number
110
- :type ipp: int
111
109
  """
112
110
  base_url = base_url.rstrip("/") + "/"
113
111
  content = f"""<h1>EODAG Server</h1><br />
@@ -125,7 +123,6 @@ def format_product_types(product_types: List[Dict[str, Any]]) -> str:
125
123
  """Format product_types
126
124
 
127
125
  :param product_types: A list of EODAG product types as returned by the core api
128
- :type product_types: list
129
126
  """
130
127
  result: List[str] = []
131
128
  for pt in product_types:
@@ -145,13 +142,9 @@ def search_stac_items(
145
142
  dictionary of STAC items.
146
143
 
147
144
  :param request: The incoming HTTP request with state information.
148
- :type request: Request
149
145
  :param search_request: The search criteria for STAC items.
150
- :type search_request: SearchPostRequest
151
146
  :param catalogs: (optional) A list of catalogs to search within. Defaults to None.
152
- :type catalogs: Optional[List[str]]
153
147
  :returns: A dictionary containing the STAC items and related metadata.
154
- :rtype: Dict[str, Any]
155
148
 
156
149
  The function handles the conversion of search criteria into STAC and EODAG compatible formats, validates the input
157
150
  using pydantic, and constructs the appropriate URLs for querying the STAC API. It also manages pagination and the
@@ -215,7 +208,7 @@ def search_stac_items(
215
208
  }
216
209
 
217
210
  search_results = eodag_api.search(count=True, **criteria)
218
- total = search_results.number_matched
211
+ total = search_results.number_matched or 0
219
212
  if search_request.crunch:
220
213
  search_results = crunch_products(
221
214
  search_results, search_request.crunch, **criteria
@@ -259,15 +252,10 @@ def download_stac_item(
259
252
  """Download item
260
253
 
261
254
  :param catalogs: Catalogs list (only first is used as product_type)
262
- :type catalogs: list
263
255
  :param item_id: Product ID
264
- :type item_id: str
265
256
  :param provider: (optional) Chosen provider
266
- :type provider: str
267
257
  :param kwargs: additional download parameters
268
- :type kwargs: Any
269
258
  :returns: a stream of the downloaded data (zip file)
270
- :rtype: Response
271
259
  """
272
260
  product_type = catalogs[0]
273
261
 
@@ -350,11 +338,13 @@ def _order_and_update(
350
338
  if (
351
339
  product.properties.get("storageStatus") != ONLINE_STATUS
352
340
  and NOT_AVAILABLE in product.properties.get("orderStatusLink", "")
353
- and hasattr(product.downloader, "orderDownload")
341
+ and hasattr(product.downloader, "order_download")
354
342
  ):
355
343
  # first order
356
344
  logger.debug("Order product")
357
- order_status_dict = product.downloader.orderDownload(product=product, auth=auth)
345
+ order_status_dict = product.downloader.order_download(
346
+ product=product, auth=auth
347
+ )
358
348
  query_args.update(order_status_dict or {})
359
349
 
360
350
  if (
@@ -365,11 +355,11 @@ def _order_and_update(
365
355
  product.properties["storageStatus"] = STAGING_STATUS
366
356
 
367
357
  if product.properties.get("storageStatus") == STAGING_STATUS and hasattr(
368
- product.downloader, "orderDownloadStatus"
358
+ product.downloader, "order_download_status"
369
359
  ):
370
360
  # check order status if needed
371
361
  logger.debug("Checking product order status")
372
- product.downloader.orderDownloadStatus(product=product, auth=auth)
362
+ product.downloader.order_download_status(product=product, auth=auth)
373
363
 
374
364
  if product.properties.get("storageStatus") != ONLINE_STATUS:
375
365
  raise NotAvailableError("Product is not available yet")
@@ -381,7 +371,6 @@ def get_detailled_collections_list() -> List[Dict[str, Any]]:
381
371
  config dicts
382
372
 
383
373
  :returns: List of config dicts
384
- :rtype: list
385
374
  """
386
375
  return eodag_api.list_product_types(fetch_providers=False)
387
376
 
@@ -398,15 +387,10 @@ async def all_collections(
398
387
  """Build STAC collections
399
388
 
400
389
  :param url: Requested URL
401
- :type url: str
402
390
  :param root: The API root
403
- :type root: str
404
391
  :param filters: Search collections filters
405
- :type filters: CollectionsSearchRequest
406
392
  :param provider: (optional) Chosen provider
407
- :type provider: str
408
393
  :returns: Collections dictionnary
409
- :rtype: dict
410
394
  """
411
395
 
412
396
  async def _fetch() -> Dict[str, Any]:
@@ -450,15 +434,10 @@ async def get_collection(
450
434
  """Build STAC collection by id
451
435
 
452
436
  :param url: Requested URL
453
- :type url: str
454
437
  :param root: API root
455
- :type root: str
456
438
  :param collection_id: Product_type as ID of the collection
457
- :type collection_id: str
458
439
  :param provider: (optional) Chosen provider
459
- :type provider: str
460
440
  :returns: Collection dictionary
461
- :rtype: dict
462
441
  """
463
442
 
464
443
  async def _fetch() -> Dict[str, Any]:
@@ -489,15 +468,10 @@ async def get_stac_catalogs(
489
468
  """Build STAC catalog
490
469
 
491
470
  :param url: Requested URL
492
- :type url: str
493
471
  :param root: (optional) API root
494
- :type root: str
495
472
  :param catalogs: (optional) Catalogs list
496
- :type catalogs: list
497
473
  :param provider: (optional) Chosen provider
498
- :type provider: str
499
474
  :returns: Catalog dictionary
500
- :rtype: dict
501
475
  """
502
476
 
503
477
  async def _fetch() -> Dict[str, Any]:
@@ -564,7 +538,6 @@ def get_stac_conformance() -> Dict[str, str]:
564
538
  """Build STAC conformance
565
539
 
566
540
  :returns: conformance dictionnary
567
- :rtype: dict
568
541
  """
569
542
  return stac_config["conformance"]
570
543
 
@@ -573,7 +546,6 @@ def get_stac_api_version() -> str:
573
546
  """Get STAC API version
574
547
 
575
548
  :returns: STAC API version
576
- :rtype: str
577
549
  """
578
550
  return stac_config["stac_api_version"]
579
551
 
@@ -583,14 +555,12 @@ def get_stac_extension_oseo(url: str) -> Dict[str, str]:
583
555
  """Build STAC OGC / OpenSearch Extension for EO
584
556
 
585
557
  :param url: Requested URL
586
- :type url: str
587
558
  :returns: Catalog dictionnary
588
- :rtype: dict
589
559
  """
590
560
 
591
- apply_method: Callable[[str, str], str] = lambda _, x: str(x).replace(
592
- "$.product.", "$."
593
- )
561
+ def apply_method(_: str, x: str) -> str:
562
+ return str(x).replace("$.product.", "$.")
563
+
594
564
  item_mapping = dict_items_recursive_apply(stac_config["item"], apply_method)
595
565
 
596
566
  # all properties as string type by default
@@ -616,9 +586,7 @@ async def get_queryables(
616
586
  """Fetch the queryable properties for a collection.
617
587
 
618
588
  :param collection_id: The ID of the collection.
619
- :type collection_id: str
620
589
  :returns: A set containing the STAC standardized queryable properties for a collection.
621
- :rtype Dict[str, StacQueryableProperty]: set
622
590
  """
623
591
 
624
592
  async def _fetch() -> Dict[str, Any]:
eodag/rest/server.py CHANGED
@@ -223,7 +223,7 @@ async def forward_middleware(
223
223
 
224
224
  @app.exception_handler(StarletteHTTPException)
225
225
  async def default_exception_handler(
226
- request: Request, error: Exception
226
+ request: Request, error: HTTPException
227
227
  ) -> ORJSONResponse:
228
228
  """Default errors handle"""
229
229
  description = (
@@ -519,11 +519,8 @@ async def list_collection_queryables(
519
519
  that can be filtered using comparison operators.
520
520
 
521
521
  :param request: The incoming request object.
522
- :type request: fastapi.Request
523
522
  :param collection_id: The identifier of the collection for which to retrieve queryable properties.
524
- :type collection_id: str
525
523
  :returns: A json object containing the list of available queryable properties for the specified collection.
526
- :rtype: Any
527
524
  """
528
525
  logger.debug(f"URL: {request.url}")
529
526
  additional_params = dict(request.query_params)
@@ -757,9 +754,7 @@ async def list_queryables(request: Request) -> ORJSONResponse:
757
754
  operators.
758
755
 
759
756
  :param request: The incoming request object.
760
- :type request: fastapi.Request
761
757
  :returns: A json object containing the list of available queryable terms.
762
- :rtype: Any
763
758
  """
764
759
  logger.debug(f"URL: {request.url}")
765
760
  additional_params = dict(request.query_params.items())