eodag 4.0.0a2__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.
eodag/api/collection.py CHANGED
@@ -132,6 +132,7 @@ class Collection(BaseModel):
132
132
  def set_id_from_alias(self) -> Self:
133
133
  """if an alias exists, use it to update id attribute"""
134
134
  if self.alias is not None:
135
+ self._id = self.id
135
136
  self.id = self.alias
136
137
  return self
137
138
 
@@ -290,7 +291,7 @@ class CollectionsDict(UserDict[str, Collection]):
290
291
  ) -> None:
291
292
  super().__init__()
292
293
 
293
- self.data = {col.id: col for col in collections}
294
+ self.data = {col._id: col for col in collections}
294
295
 
295
296
  def __str__(self) -> str:
296
297
  return "{" + ", ".join(f'"{col}": {col_f}' for col, col_f in self.items()) + "}"
eodag/api/core.py CHANGED
@@ -567,8 +567,6 @@ class EODataAccessGateway:
567
567
  # First, update collections list if possible
568
568
  self.fetch_collections_list(provider=provider)
569
569
 
570
- collections: CollectionsList = CollectionsList([])
571
-
572
570
  providers_configs = (
573
571
  list(self.providers_config.values())
574
572
  if not provider
@@ -584,15 +582,17 @@ class EODataAccessGateway:
584
582
  f"The requested provider is not (yet) supported: {provider}"
585
583
  )
586
584
 
587
- for p in providers_configs:
588
- for collection_id in p.products:
589
- if collection_id == GENERIC_COLLECTION:
590
- continue
585
+ # unique collection ids from providers configs
586
+ collection_ids = {
587
+ collection_id
588
+ for p in providers_configs
589
+ for collection_id in p.products
590
+ if collection_id != GENERIC_COLLECTION
591
+ }
591
592
 
592
- if (
593
- collection := self.collections_config[collection_id]
594
- ) not in collections:
595
- collections.append(collection)
593
+ collections = CollectionsList(
594
+ [self.collections_config[collection_id] for collection_id in collection_ids]
595
+ )
596
596
 
597
597
  # Return the collections sorted in lexicographic order of their id
598
598
  collections.sort(key=attrgetter("id"))
@@ -881,15 +881,14 @@ class EODataAccessGateway:
881
881
  try:
882
882
  # new_collection_conf does not already exist, append it
883
883
  # to self.collections_config
884
- self.collections_config[
885
- new_collection
886
- ] = Collection.create_with_dag(
884
+ new_coll_obj = Collection.create_with_dag(
887
885
  self,
888
886
  id=new_collection,
889
887
  **new_collections_conf["collections_config"][
890
888
  new_collection
891
889
  ],
892
890
  )
891
+ self.collections_config[new_coll_obj._id] = new_coll_obj
893
892
  except ValidationError:
894
893
  # skip collection if there is a problem with its id (missing or not a string)
895
894
  logger.debug(
@@ -910,7 +909,7 @@ class EODataAccessGateway:
910
909
  # increase the increment if the new collection had
911
910
  # bad formatted attributes in the external config
912
911
  dumped_collection = self.collections_config[
913
- new_collection
912
+ new_coll_obj._id
914
913
  ].model_dump()
915
914
  dumped_ext_conf_col = {
916
915
  **dumped_collection,
@@ -988,7 +987,7 @@ class EODataAccessGateway:
988
987
  :returns: Internal name of the collection.
989
988
  """
990
989
  collections = [
991
- k for k, v in self.collections_config.items() if v.alias == alias_or_id
990
+ v for k, v in self.collections_config.items() if v.id == alias_or_id
992
991
  ]
993
992
 
994
993
  if len(collections) > 1:
@@ -1004,7 +1003,7 @@ class EODataAccessGateway:
1004
1003
  f"Could not find collection from alias or id {alias_or_id}"
1005
1004
  )
1006
1005
 
1007
- return collections[0]
1006
+ return collections[0]._id or collections[0].id
1008
1007
 
1009
1008
  def get_alias_from_collection(self, collection: str) -> str:
1010
1009
  """Return the alias of a collection by its id. If no alias was defined for the
@@ -1059,13 +1058,16 @@ class EODataAccessGateway:
1059
1058
  :raises: :class:`~eodag.utils.exceptions.NoMatchingCollection`
1060
1059
  """
1061
1060
  if collection := kwargs.get("collection"):
1062
- try:
1063
- collection = self.get_collection_from_alias(collection)
1061
+ if collection in self.collections_config:
1064
1062
  return CollectionsList([self.collections_config[collection]])
1065
- except NoMatchingCollection:
1066
- return CollectionsList(
1067
- [Collection.create_with_dag(self, id=collection)]
1068
- )
1063
+ else:
1064
+ try:
1065
+ collection = self.get_collection_from_alias(collection)
1066
+ return CollectionsList([self.collections_config[collection]])
1067
+ except NoMatchingCollection:
1068
+ return CollectionsList(
1069
+ [Collection.create_with_dag(self, id=collection)]
1070
+ )
1069
1071
 
1070
1072
  filters: dict[str, str] = {
1071
1073
  k: v
@@ -1100,7 +1102,6 @@ class EODataAccessGateway:
1100
1102
  or col not in self._plugins_manager.collection_to_provider_config_map
1101
1103
  ):
1102
1104
  continue
1103
-
1104
1105
  score = 0 # how many filters matched
1105
1106
 
1106
1107
  # free text search
@@ -1147,16 +1148,24 @@ class EODataAccessGateway:
1147
1148
  min_aware = datetime.datetime.min.replace(tzinfo=datetime.timezone.utc)
1148
1149
  max_aware = datetime.datetime.max.replace(tzinfo=datetime.timezone.utc)
1149
1150
 
1150
- col_start = col_f.extent.temporal.interval[0][0]
1151
- col_end = col_f.extent.temporal.interval[0][1]
1151
+ col_start_str = col_f.extent.temporal.interval[0][0]
1152
+ if col_start_str and isinstance(col_start_str, str):
1153
+ col_start = rfc3339_str_to_datetime(col_start_str)
1154
+ else:
1155
+ col_start = col_start_str or min_aware
1156
+ col_end_str = col_f.extent.temporal.interval[0][1]
1157
+ if col_end_str and isinstance(col_end_str, str):
1158
+ col_end = rfc3339_str_to_datetime(col_end_str)
1159
+ else:
1160
+ col_end = col_end_str or max_aware
1152
1161
 
1153
1162
  max_start = max(
1154
1163
  rfc3339_str_to_datetime(start_date) if start_date else min_aware,
1155
- col_start or min_aware,
1164
+ col_start,
1156
1165
  )
1157
1166
  min_end = min(
1158
1167
  rfc3339_str_to_datetime(end_date) if end_date else max_aware,
1159
- col_end or max_aware,
1168
+ col_end,
1160
1169
  )
1161
1170
  if not (max_start <= min_end):
1162
1171
  continue
@@ -6046,8 +6046,8 @@
6046
6046
  next_page_url_key_path: null
6047
6047
  next_page_query_obj_key_path: null
6048
6048
  next_page_token_key: page
6049
- # 1000 is ok and 2000 fails
6050
- max_items_per_page: 1000
6049
+ # As of 2025/11/21 the geodes API documentation (https://geodes.cnes.fr/support/api/) states that pagination must be limited to 80.
6050
+ max_items_per_page: 80
6051
6051
  sort:
6052
6052
  sort_by_tpl: '{{"sortBy": [ {{"field": "{sort_param}", "direction": "{sort_order}" }} ] }}'
6053
6053
  sort_by_default:
@@ -6176,8 +6176,8 @@
6176
6176
  next_page_url_key_path: null
6177
6177
  next_page_query_obj_key_path: null
6178
6178
  next_page_token_key: page
6179
- # 1000 is ok and 2000 fails
6180
- max_items_per_page: 1000
6179
+ # As of 2025/11/21 the geodes API documentation (https://geodes.cnes.fr/support/api/) states that pagination must be limited to 80.
6180
+ max_items_per_page: 80
6181
6181
  sort:
6182
6182
  sort_by_tpl: '{{"sortBy": [ {{"field": "{sort_param}", "direction": "{sort_order}" }} ] }}'
6183
6183
  sort_by_default:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eodag
3
- Version: 4.0.0a2
3
+ Version: 4.0.0a3
4
4
  Summary: Earth Observation Data Access Gateway
5
5
  Home-page: https://github.com/CS-SI/eodag
6
6
  Author: CS GROUP - France
@@ -4,8 +4,8 @@ eodag/config.py,sha256=uErvz-nQHPRAzUnlxSgq5SxHCxWfDSML3xhm_BDBR1s,49862
4
4
  eodag/crunch.py,sha256=fLVAPGVPw31N_DrnFk4gkCpQZLMY8oBhK6NUSYmdr24,1099
5
5
  eodag/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  eodag/api/__init__.py,sha256=ytr30NUVmEtmJTsp3QCwkCIhS1nF6UlFCv0vmySHN7g,735
7
- eodag/api/collection.py,sha256=qiVtXO6eqAJTmJFiKKXbHFXbQRlttojW_3kKegOjZYo,13720
8
- eodag/api/core.py,sha256=82c7CHEhHdnkHDlzIxHigaYGereQ8aECkTnsBv5dWUk,107085
7
+ eodag/api/collection.py,sha256=m-lrzQCCKRF8fEp6k2hzIr1ap-8UP11jmkGTmJ6dBtw,13752
8
+ eodag/api/core.py,sha256=fKjID4B1btXHHlZqxqyuqYlmehBieWRZtKFiJ96nveo,107671
9
9
  eodag/api/search_result.py,sha256=LGWIQgbhQF5Lz489vcvalb2VsYtplyzUXGWMqduP0uc,21107
10
10
  eodag/api/product/__init__.py,sha256=6-RXKAw-sZVNU-7KjpmSqLc35dfc0V42wI5GqIzH2QA,2501
11
11
  eodag/api/product/_assets.py,sha256=9bWIe_SYvsQO-q_lQFd7SxhUIWv7feze2-wnXOe8hhs,7570
@@ -58,7 +58,7 @@ eodag/resources/collections.yml,sha256=0JZr5y8V8QlB1MGqGzs5-Pmrk1ZYkEBlS3VYrg22N
58
58
  eodag/resources/ext_collections.json,sha256=8BSdJ_G0F9LG9h_Z_EOTmSmhceDl3-uFVaW7iVoh4qo,2438459
59
59
  eodag/resources/ext_product_types.json,sha256=DaM0YN_V5gdMDyb1zHnF37YC8eOQhG4i-byB9d2gcT8,2456884
60
60
  eodag/resources/locations_conf_template.yml,sha256=_eBv-QKHYMIKhY0b0kp4Ee33RsayxN8LWH3kDXxfFSk,986
61
- eodag/resources/providers.yml,sha256=1EK66cdWNG0T6d8YfPfs1nl4fQ4oDvX10vn5h_WsxWE,237678
61
+ eodag/resources/providers.yml,sha256=2ryHvNIaBpETbAJUQzXAbY08crWxzbBUfTJ1yprVZr0,237882
62
62
  eodag/resources/stac_provider.yml,sha256=RNhFNhv7593VkY2od-LQgUBdIO1WXL1Rko7UyjLaxFY,4648
63
63
  eodag/resources/user_conf_template.yml,sha256=aHSiscSQ3B4Dd18709iQAX7tFrkMufRC1a9akcNVVTs,7541
64
64
  eodag/resources/shp/ne_110m_admin_0_map_units.VERSION.txt,sha256=CHSo_jbv-4d4D0MYRbWn2FvmV_K9mYzo7qznF4YNO3g,7
@@ -85,9 +85,9 @@ eodag/utils/repr.py,sha256=72BIKFq07aU4YrQVJJX-AADdWXAhJqC4LXGmkbCo1kA,5537
85
85
  eodag/utils/requests.py,sha256=avNHKrOZ7Kp6lUA7u4kqupIth9MoirLzDsMrrmQDt4s,4560
86
86
  eodag/utils/s3.py,sha256=eESanPLVv-Luqo_o1WgUuO7YLqiXg_iEzHZ15fu-ugY,30063
87
87
  eodag/utils/stac_reader.py,sha256=8r6amio5EtwGF9iu9zHaGDz4oUPKKeXRuyTzPNakrO4,9406
88
- eodag-4.0.0a2.dist-info/licenses/LICENSE,sha256=4MAecetnRTQw5DlHtiikDSzKWO1xVLwzM5_DsPMYlnE,10172
89
- eodag-4.0.0a2.dist-info/METADATA,sha256=GDIvwACmfGQA6E-XFIfoCkkr4tblKoFg2m4jgdIEuek,12739
90
- eodag-4.0.0a2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
91
- eodag-4.0.0a2.dist-info/entry_points.txt,sha256=atMIh-Q4hRsOdw1_778mDIhWFHQJigEo3x-0fMqhqLE,2254
92
- eodag-4.0.0a2.dist-info/top_level.txt,sha256=025IMTmVe5eDjIPP4KEFQKespOPMQdne4U4jOy8nftM,6
93
- eodag-4.0.0a2.dist-info/RECORD,,
88
+ eodag-4.0.0a3.dist-info/licenses/LICENSE,sha256=4MAecetnRTQw5DlHtiikDSzKWO1xVLwzM5_DsPMYlnE,10172
89
+ eodag-4.0.0a3.dist-info/METADATA,sha256=fiwL-AiTQrS3gNc3WEwe_BFmec9qV1ZS75QK1a4gLCA,12739
90
+ eodag-4.0.0a3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
91
+ eodag-4.0.0a3.dist-info/entry_points.txt,sha256=atMIh-Q4hRsOdw1_778mDIhWFHQJigEo3x-0fMqhqLE,2254
92
+ eodag-4.0.0a3.dist-info/top_level.txt,sha256=025IMTmVe5eDjIPP4KEFQKespOPMQdne4U4jOy8nftM,6
93
+ eodag-4.0.0a3.dist-info/RECORD,,