eodag 3.10.1__py3-none-any.whl → 4.0.0a2__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 (75) hide show
  1. eodag/__init__.py +6 -1
  2. eodag/api/collection.py +353 -0
  3. eodag/api/core.py +606 -641
  4. eodag/api/product/__init__.py +3 -3
  5. eodag/api/product/_product.py +74 -56
  6. eodag/api/product/drivers/__init__.py +4 -46
  7. eodag/api/product/drivers/base.py +0 -28
  8. eodag/api/product/metadata_mapping.py +178 -216
  9. eodag/api/search_result.py +156 -15
  10. eodag/cli.py +83 -403
  11. eodag/config.py +81 -51
  12. eodag/plugins/apis/base.py +2 -2
  13. eodag/plugins/apis/ecmwf.py +36 -25
  14. eodag/plugins/apis/usgs.py +55 -40
  15. eodag/plugins/authentication/base.py +1 -3
  16. eodag/plugins/crunch/filter_date.py +3 -3
  17. eodag/plugins/crunch/filter_latest_intersect.py +2 -2
  18. eodag/plugins/crunch/filter_latest_tpl_name.py +1 -1
  19. eodag/plugins/download/aws.py +46 -42
  20. eodag/plugins/download/base.py +13 -14
  21. eodag/plugins/download/http.py +65 -65
  22. eodag/plugins/manager.py +28 -29
  23. eodag/plugins/search/__init__.py +6 -4
  24. eodag/plugins/search/base.py +131 -80
  25. eodag/plugins/search/build_search_result.py +245 -173
  26. eodag/plugins/search/cop_marine.py +87 -56
  27. eodag/plugins/search/csw.py +47 -37
  28. eodag/plugins/search/qssearch.py +653 -429
  29. eodag/plugins/search/stac_list_assets.py +1 -1
  30. eodag/plugins/search/static_stac_search.py +43 -44
  31. eodag/resources/{product_types.yml → collections.yml} +2594 -2453
  32. eodag/resources/ext_collections.json +1 -1
  33. eodag/resources/ext_product_types.json +1 -1
  34. eodag/resources/providers.yml +2706 -2733
  35. eodag/resources/stac_provider.yml +50 -92
  36. eodag/resources/user_conf_template.yml +9 -0
  37. eodag/types/__init__.py +2 -0
  38. eodag/types/queryables.py +70 -91
  39. eodag/types/search_args.py +1 -1
  40. eodag/utils/__init__.py +97 -21
  41. eodag/utils/dates.py +0 -12
  42. eodag/utils/exceptions.py +6 -6
  43. eodag/utils/free_text_search.py +3 -3
  44. eodag/utils/repr.py +2 -0
  45. {eodag-3.10.1.dist-info → eodag-4.0.0a2.dist-info}/METADATA +13 -99
  46. eodag-4.0.0a2.dist-info/RECORD +93 -0
  47. {eodag-3.10.1.dist-info → eodag-4.0.0a2.dist-info}/entry_points.txt +0 -4
  48. eodag/plugins/authentication/oauth.py +0 -60
  49. eodag/plugins/download/creodias_s3.py +0 -71
  50. eodag/plugins/download/s3rest.py +0 -351
  51. eodag/plugins/search/data_request_search.py +0 -565
  52. eodag/resources/stac.yml +0 -294
  53. eodag/resources/stac_api.yml +0 -2105
  54. eodag/rest/__init__.py +0 -24
  55. eodag/rest/cache.py +0 -70
  56. eodag/rest/config.py +0 -67
  57. eodag/rest/constants.py +0 -26
  58. eodag/rest/core.py +0 -764
  59. eodag/rest/errors.py +0 -210
  60. eodag/rest/server.py +0 -604
  61. eodag/rest/server.wsgi +0 -6
  62. eodag/rest/stac.py +0 -1032
  63. eodag/rest/templates/README +0 -1
  64. eodag/rest/types/__init__.py +0 -18
  65. eodag/rest/types/collections_search.py +0 -44
  66. eodag/rest/types/eodag_search.py +0 -386
  67. eodag/rest/types/queryables.py +0 -174
  68. eodag/rest/types/stac_search.py +0 -272
  69. eodag/rest/utils/__init__.py +0 -207
  70. eodag/rest/utils/cql_evaluate.py +0 -119
  71. eodag/rest/utils/rfc3339.py +0 -64
  72. eodag-3.10.1.dist-info/RECORD +0 -116
  73. {eodag-3.10.1.dist-info → eodag-4.0.0a2.dist-info}/WHEEL +0 -0
  74. {eodag-3.10.1.dist-info → eodag-4.0.0a2.dist-info}/licenses/LICENSE +0 -0
  75. {eodag-3.10.1.dist-info → eodag-4.0.0a2.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"