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
eodag/rest/__init__.py DELETED
@@ -1,24 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # Copyright 2018, 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
- """EODAG REST API"""
19
- try:
20
- from fastapi import __version__ # noqa: F401
21
- except ImportError:
22
- raise ImportError(
23
- f"{__name__} not available, please install eodag[server] or eodag[all]"
24
- )
eodag/rest/cache.py DELETED
@@ -1,70 +0,0 @@
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 typing import Any, Callable, Coroutine, TypeVar, cast
20
-
21
- import orjson
22
- from cachetools import LRUCache
23
- from fastapi import FastAPI, Request
24
-
25
- from eodag.rest.config import Settings
26
- from eodag.utils import urlsplit
27
-
28
- logger = logging.getLogger("eodag.rest.utils")
29
-
30
- T = TypeVar("T")
31
-
32
-
33
- def init_cache(app: FastAPI) -> None:
34
- """Connect to local cache"""
35
- settings = Settings.from_environment()
36
-
37
- app.state.cache = LRUCache(maxsize=settings.cache_maxsize)
38
-
39
-
40
- async def cached(
41
- fn: Callable[[], Coroutine[Any, Any, T]], cache_key: str, request: Request
42
- ) -> T:
43
- """Either get the result from local cache or run the function and cache the result."""
44
- settings = Settings.from_environment()
45
-
46
- host = urlsplit(cast(str, request.state.url_root)).netloc
47
-
48
- host_cache_key = f"{cache_key}:{host}"
49
-
50
- try:
51
- c: dict[str, Any] = request.app.state.cache
52
-
53
- if cached := c.get(host_cache_key):
54
- logger.debug("Cache result hit")
55
- return orjson.loads(cached) # type: ignore
56
- except Exception as e:
57
- logger.error(f"Error in cache: {e}")
58
- if settings.debug:
59
- raise
60
-
61
- result = await fn()
62
-
63
- try:
64
- c[host_cache_key] = orjson.dumps(result) # type: ignore
65
- except Exception as e:
66
- logger.error(f"Error in cache: {e}")
67
- if settings.debug:
68
- raise
69
-
70
- return result
eodag/rest/config.py DELETED
@@ -1,67 +0,0 @@
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
- from __future__ import annotations
19
-
20
- from functools import lru_cache
21
- from typing import Annotated, Union
22
-
23
- from pydantic import Field
24
- from pydantic.functional_validators import BeforeValidator
25
- from pydantic_settings import BaseSettings, SettingsConfigDict
26
- from typing_extensions import Doc
27
-
28
- from eodag.rest.constants import DEFAULT_MAXSIZE, DEFAULT_TTL
29
-
30
-
31
- def str2liststr(raw: Union[str, list[str]]) -> list[str]:
32
- """Convert str to list[str]"""
33
- if isinstance(raw, list):
34
- return raw
35
- return raw.split(",")
36
-
37
-
38
- class Settings(BaseSettings):
39
- """EODAG Server config"""
40
-
41
- # local cache config
42
- cache_ttl: int = Field(default=DEFAULT_TTL)
43
- cache_maxsize: int = Field(default=DEFAULT_MAXSIZE)
44
-
45
- debug: bool = False
46
-
47
- stac_api_title: str = "eodag-stac-api"
48
- stac_api_description: str = "STAC API provided by EODAG"
49
- stac_api_landing_id: str = "eodag-stac-api"
50
-
51
- origin_url_blacklist: Annotated[
52
- Union[str, list[str]],
53
- BeforeValidator(str2liststr),
54
- Doc(
55
- "Hide from clients items assets' alternative URLs starting with URLs from the list"
56
- ),
57
- ] = Field(default=[])
58
-
59
- model_config = SettingsConfigDict(
60
- env_prefix="EODAG_", extra="ignore", env_nested_delimiter="__"
61
- )
62
-
63
- @classmethod
64
- @lru_cache(maxsize=1)
65
- def from_environment(cls) -> Settings:
66
- """Get settings"""
67
- return Settings()
eodag/rest/constants.py DELETED
@@ -1,26 +0,0 @@
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
- # default cache ttl
19
- DEFAULT_TTL = 600 # 10 min
20
-
21
- DEFAULT_MAXSIZE = 2048 # local cache maxsize
22
-
23
- CACHE_KEY_COLLECTIONS = "collections"
24
- CACHE_KEY_COLLECTION = "collection"
25
- CACHE_KEY_SEARCH = "search"
26
- CACHE_KEY_QUERYABLES = "queryables"