eodag 4.0.0a2__py3-none-any.whl → 4.0.0a4__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 +10 -9
- eodag/api/core.py +233 -335
- eodag/api/product/_product.py +3 -3
- eodag/api/provider.py +990 -0
- eodag/cli.py +1 -3
- eodag/config.py +73 -444
- eodag/plugins/authentication/token.py +0 -1
- eodag/plugins/download/http.py +0 -1
- eodag/plugins/manager.py +24 -34
- eodag/resources/ext_collections.json +1 -1
- eodag/resources/ext_product_types.json +1 -1
- eodag/resources/providers.yml +4 -4
- {eodag-4.0.0a2.dist-info → eodag-4.0.0a4.dist-info}/METADATA +1 -1
- {eodag-4.0.0a2.dist-info → eodag-4.0.0a4.dist-info}/RECORD +18 -17
- {eodag-4.0.0a2.dist-info → eodag-4.0.0a4.dist-info}/WHEEL +0 -0
- {eodag-4.0.0a2.dist-info → eodag-4.0.0a4.dist-info}/entry_points.txt +0 -0
- {eodag-4.0.0a2.dist-info → eodag-4.0.0a4.dist-info}/licenses/LICENSE +0 -0
- {eodag-4.0.0a2.dist-info → eodag-4.0.0a4.dist-info}/top_level.txt +0 -0
eodag/api/collection.py
CHANGED
|
@@ -130,8 +130,9 @@ class Collection(BaseModel):
|
|
|
130
130
|
|
|
131
131
|
@model_validator(mode="after")
|
|
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
|
|
|
@@ -140,9 +141,9 @@ class Collection(BaseModel):
|
|
|
140
141
|
def validate_collection(
|
|
141
142
|
cls, values: dict[str, Any] | Self, handler: ModelWrapValidatorHandler[Self]
|
|
142
143
|
) -> Self:
|
|
143
|
-
"""Allow to create a collection instance with bad formatted attributes (except
|
|
144
|
-
Set incorrectly formatted attributes to None and ignore extra attributes.
|
|
145
|
-
Log a warning about validation errors if EODAG_VALIDATE_COLLECTIONS is set to True
|
|
144
|
+
"""Allow to create a collection instance with bad formatted attributes (except ``id``).
|
|
145
|
+
Set incorrectly formatted attributes to ``None`` and ignore extra attributes.
|
|
146
|
+
Log a warning about validation errors if ``EODAG_VALIDATE_COLLECTIONS`` environment variable is set to ``True``.
|
|
146
147
|
"""
|
|
147
148
|
errors: list[ErrorDetails] = []
|
|
148
149
|
continue_validation: bool = True
|
|
@@ -236,7 +237,7 @@ class Collection(BaseModel):
|
|
|
236
237
|
return self._dag
|
|
237
238
|
|
|
238
239
|
def search(self, **kwargs: Any) -> SearchResult:
|
|
239
|
-
"""Look for products of this collection matching criteria using the
|
|
240
|
+
"""Look for products of this collection matching criteria using the ``dag`` attribute of the instance.
|
|
240
241
|
|
|
241
242
|
:param kwargs: Some other criteria that will be used to do the search,
|
|
242
243
|
using parameters compatible with the provider
|
|
@@ -256,12 +257,12 @@ class Collection(BaseModel):
|
|
|
256
257
|
return dag.search(collection=self.id, **kwargs)
|
|
257
258
|
|
|
258
259
|
def list_queryables(self, **kwargs: Any) -> QueryablesDict:
|
|
259
|
-
"""Fetch the queryable properties for this collection using the
|
|
260
|
+
"""Fetch the queryable properties for this collection using the ``dag`` attribute of the instance.
|
|
260
261
|
|
|
261
262
|
:param kwargs: additional filters for queryables
|
|
262
263
|
|
|
263
264
|
:returns: A :class:`~eodag.api.product.queryables.QuerybalesDict` containing the EODAG queryable
|
|
264
|
-
properties, associating parameters to their annotated type, and
|
|
265
|
+
properties, associating parameters to their annotated type, and an ``additional_properties`` attribute
|
|
265
266
|
:raises: :class:`~eodag.utils.exceptions.ValidationError`: If the `collection` argument is set in `kwargs`,
|
|
266
267
|
since it is already defined by the instance
|
|
267
268
|
"""
|
|
@@ -277,7 +278,7 @@ class Collection(BaseModel):
|
|
|
277
278
|
|
|
278
279
|
|
|
279
280
|
class CollectionsDict(UserDict[str, Collection]):
|
|
280
|
-
"""A UserDict object which values are :class:`~eodag.api.collection.Collection` objects, keyed by provider id
|
|
281
|
+
"""A UserDict object which values are :class:`~eodag.api.collection.Collection` objects, keyed by provider ``id``.
|
|
281
282
|
|
|
282
283
|
:param collections: A list of collections
|
|
283
284
|
|
|
@@ -290,7 +291,7 @@ class CollectionsDict(UserDict[str, Collection]):
|
|
|
290
291
|
) -> None:
|
|
291
292
|
super().__init__()
|
|
292
293
|
|
|
293
|
-
self.data = {col.
|
|
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()) + "}"
|