eodag 3.0.0b2__py3-none-any.whl → 3.0.1__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 (84) hide show
  1. eodag/__init__.py +6 -8
  2. eodag/api/core.py +295 -287
  3. eodag/api/product/__init__.py +10 -4
  4. eodag/api/product/_assets.py +2 -14
  5. eodag/api/product/_product.py +16 -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 +12 -31
  9. eodag/api/search_result.py +33 -12
  10. eodag/cli.py +35 -19
  11. eodag/config.py +455 -155
  12. eodag/plugins/apis/base.py +13 -7
  13. eodag/plugins/apis/ecmwf.py +16 -7
  14. eodag/plugins/apis/usgs.py +68 -16
  15. eodag/plugins/authentication/aws_auth.py +25 -7
  16. eodag/plugins/authentication/base.py +10 -1
  17. eodag/plugins/authentication/generic.py +14 -3
  18. eodag/plugins/authentication/header.py +12 -4
  19. eodag/plugins/authentication/keycloak.py +41 -22
  20. eodag/plugins/authentication/oauth.py +11 -1
  21. eodag/plugins/authentication/openid_connect.py +183 -167
  22. eodag/plugins/authentication/qsauth.py +12 -4
  23. eodag/plugins/authentication/sas_auth.py +19 -2
  24. eodag/plugins/authentication/token.py +59 -11
  25. eodag/plugins/authentication/token_exchange.py +19 -19
  26. eodag/plugins/crunch/base.py +7 -2
  27. eodag/plugins/crunch/filter_date.py +8 -11
  28. eodag/plugins/crunch/filter_latest_intersect.py +5 -7
  29. eodag/plugins/crunch/filter_latest_tpl_name.py +2 -5
  30. eodag/plugins/crunch/filter_overlap.py +9 -15
  31. eodag/plugins/crunch/filter_property.py +9 -14
  32. eodag/plugins/download/aws.py +84 -99
  33. eodag/plugins/download/base.py +36 -77
  34. eodag/plugins/download/creodias_s3.py +11 -2
  35. eodag/plugins/download/http.py +134 -109
  36. eodag/plugins/download/s3rest.py +37 -43
  37. eodag/plugins/manager.py +173 -41
  38. eodag/plugins/search/__init__.py +9 -9
  39. eodag/plugins/search/base.py +35 -35
  40. eodag/plugins/search/build_search_result.py +55 -64
  41. eodag/plugins/search/cop_marine.py +113 -32
  42. eodag/plugins/search/creodias_s3.py +20 -8
  43. eodag/plugins/search/csw.py +41 -1
  44. eodag/plugins/search/data_request_search.py +119 -14
  45. eodag/plugins/search/qssearch.py +619 -197
  46. eodag/plugins/search/static_stac_search.py +25 -23
  47. eodag/resources/ext_product_types.json +1 -1
  48. eodag/resources/product_types.yml +211 -56
  49. eodag/resources/providers.yml +1762 -1809
  50. eodag/resources/stac.yml +3 -163
  51. eodag/resources/user_conf_template.yml +134 -119
  52. eodag/rest/config.py +1 -2
  53. eodag/rest/constants.py +0 -1
  54. eodag/rest/core.py +70 -92
  55. eodag/rest/errors.py +181 -0
  56. eodag/rest/server.py +24 -330
  57. eodag/rest/stac.py +105 -630
  58. eodag/rest/types/eodag_search.py +17 -15
  59. eodag/rest/types/queryables.py +5 -14
  60. eodag/rest/types/stac_search.py +18 -13
  61. eodag/rest/utils/rfc3339.py +0 -1
  62. eodag/types/__init__.py +24 -6
  63. eodag/types/download_args.py +14 -5
  64. eodag/types/queryables.py +1 -2
  65. eodag/types/search_args.py +10 -11
  66. eodag/types/whoosh.py +0 -2
  67. eodag/utils/__init__.py +97 -136
  68. eodag/utils/constraints.py +0 -8
  69. eodag/utils/exceptions.py +23 -9
  70. eodag/utils/import_system.py +0 -4
  71. eodag/utils/logging.py +37 -80
  72. eodag/utils/notebook.py +4 -4
  73. eodag/utils/requests.py +13 -23
  74. eodag/utils/rest.py +0 -4
  75. eodag/utils/stac_reader.py +3 -15
  76. {eodag-3.0.0b2.dist-info → eodag-3.0.1.dist-info}/METADATA +41 -24
  77. eodag-3.0.1.dist-info/RECORD +109 -0
  78. {eodag-3.0.0b2.dist-info → eodag-3.0.1.dist-info}/WHEEL +1 -1
  79. {eodag-3.0.0b2.dist-info → eodag-3.0.1.dist-info}/entry_points.txt +1 -0
  80. eodag/resources/constraints/climate-dt.json +0 -13
  81. eodag/resources/constraints/extremes-dt.json +0 -8
  82. eodag-3.0.0b2.dist-info/RECORD +0 -110
  83. {eodag-3.0.0b2.dist-info → eodag-3.0.1.dist-info}/LICENSE +0 -0
  84. {eodag-3.0.0b2.dist-info → eodag-3.0.1.dist-info}/top_level.txt +0 -0
@@ -18,7 +18,7 @@
18
18
  from __future__ import annotations
19
19
 
20
20
  import logging
21
- from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, cast
21
+ from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple
22
22
  from unittest import mock
23
23
 
24
24
  import geojson
@@ -44,25 +44,23 @@ logger = logging.getLogger("eodag.search.static_stac_search")
44
44
  class StaticStacSearch(StacSearch):
45
45
  """Static STAC Catalog search plugin
46
46
 
47
- The available configuration parameters for this plugin are
48
- (to be set in provider configuration):
49
-
50
- - **api_endpoint**: (mandatory) path to the catalog (url or local system path)
47
+ This plugin first loads all STAC items found in the catalog, and converts them to
48
+ EOProducts using :class:`~eodag.plugins.search.qssearch.StacSearch`.
49
+ Then it uses crunchers to only keep products matching query parameters.
51
50
 
52
- - **max_connections**: (optional) Maximum number of connections for HTTP requests,
53
- defaut is 100.
51
+ The plugin inherits the configuration parameters from :class:`~eodag.plugins.search.qssearch.PostJsonSearch`
52
+ (via the :class:`~eodag.plugins.search.qssearch.StacSearch` inheritance) with the following particularities:
54
53
 
55
- - **timeout**: (mandatory) Timeout in seconds for each internal HTTP request,
56
- default is 5.
54
+ :param provider: provider name
55
+ :param config: Search plugin configuration:
57
56
 
58
- This plugin first loads all STAC items found in the catalog, and converts them to
59
- EOProducts using StacSearch.
60
- Then it uses crunchers to only keep products matching query parameters.
57
+ * :attr:`~eodag.config.PluginConfig.api_endpoint` (``str``) (**mandatory**): path to the catalog;
58
+ in contrast to the api_endpoint for other plugin types this can be a url or local system path.
59
+ * :attr:`~eodag.config.PluginConfig.max_connections` (``int``): Maximum number of concurrent
60
+ connections for HTTP requests; default: ``100``
61
+ * :attr:`~eodag.config.PluginConfig.timeout` (``int``): Timeout in seconds for each
62
+ internal HTTP request; default: ``5``
61
63
 
62
- :param provider: An eodag providers configuration dictionary
63
- :type provider: dict
64
- :param config: Path to the user configuration file
65
- :type config: str
66
64
  """
67
65
 
68
66
  def __init__(self, provider: str, config: PluginConfig) -> None:
@@ -85,19 +83,23 @@ class StaticStacSearch(StacSearch):
85
83
  "total_items_nb_key_path", "$.null"
86
84
  )
87
85
  self.config.__dict__["pagination"].setdefault("max_items_per_page", -1)
86
+ # disable product types discovery by default (if endpoints equals to STAC API default)
87
+ if (
88
+ getattr(self.config, "discover_product_types", {}).get("fetch_url")
89
+ == "{api_endpoint}/../collections"
90
+ ):
91
+ self.config.discover_product_types = {}
88
92
 
89
93
  def discover_product_types(self, **kwargs: Any) -> Optional[Dict[str, Any]]:
90
94
  """Fetch product types list from a static STAC Catalog provider using `discover_product_types` conf
91
95
 
92
96
  :returns: configuration dict containing fetched product types information
93
- :rtype: Optional[Dict[str, Any]]
94
97
  """
95
- fetch_url = cast(
96
- str,
97
- self.config.discover_product_types["fetch_url"].format(
98
- **self.config.__dict__
99
- ),
100
- )
98
+ unformatted_fetch_url = self.config.discover_product_types.get("fetch_url")
99
+ if unformatted_fetch_url is None:
100
+ return None
101
+ fetch_url = unformatted_fetch_url.format(**self.config.__dict__)
102
+
101
103
  collections = fetch_stac_collections(
102
104
  fetch_url,
103
105
  collection=kwargs.get("q"),