Search Plugins#

Search plugins must inherit the following class and implement query():

class eodag.plugins.search.base.Search(provider: str, config: PluginConfig)[source]#

Base Search Plugin.

Parameters:
  • provider (str) – An EODAG provider name

  • config (PluginConfig) – An EODAG plugin configuration

build_sort_by(sort_by_arg: SortByList) Tuple[str, Dict[str, List[Dict[str, str]]]][source]#

Build the sorting part of the query string or body by transforming the “sortBy” argument into a provider-specific string or dictionnary

Parameters:

sort_by_arg (SortByList) – the “sortBy” argument in EODAG format

Returns:

The “sortBy” argument in provider-specific format

Return type:

Union[str, Dict[str, List[Dict[str, str]]]]

clear() None[source]#

Method used to clear a search context between two searches.

discover_product_types(**kwargs: Any) Dict[str, Any] | None[source]#

Fetch product types list from provider using discover_product_types conf

discover_queryables(**kwargs: Any) Dict[str, Annotated[Any, FieldInfo]] | None[source]#

Fetch queryables list from provider using discover_queryables conf

Parameters:

kwargs (Any) – additional filters for queryables (productType and other search arguments)

Returns:

fetched queryable parameters dict

Return type:

Optional[Dict[str, Annotated[Any, FieldInfo]]]

get_metadata_mapping(product_type: str | None = None) Dict[str, str | List[str]][source]#

Get the plugin metadata mapping configuration (product type specific if exists)

Parameters:

product_type (str) – the desired product type

Returns:

The product type specific metadata-mapping

Return type:

dict

get_product_type_def_params(product_type: str, **kwargs: Any) Dict[str, Any][source]#

Get the provider product type definition parameters and specific settings

Parameters:

product_type (str) – the desired product type

Returns:

The product type definition parameters

Return type:

dict

get_sort_by_arg(kwargs: Dict[str, Any]) SortByList | None[source]#

Extract the “sortBy” argument from the kwargs or the provider default sort configuration

Parameters:

kwargs (Dict[str, Any]) – Search arguments

Returns:

The “sortBy” argument from the kwargs or the provider default sort configuration

Return type:

SortByList

list_queryables(filters: Dict[str, Any], product_type: str | None = None) Dict[str, Annotated[Any, FieldInfo]][source]#

Get queryables

Parameters:
  • filters (Dict[str, Any]) – Additional filters for queryables.

  • product_type (Optional[str]) – (optional) The product type.

Returns:

A dictionary containing the queryable properties, associating parameters to their annotated type.

Return type:

Dict[str, Annotated[Any, FieldInfo]]

map_product_type(product_type: str | None, **kwargs: Any) str | None[source]#

Get the provider product type from eodag product type

Parameters:

product_type (str) – eodag product type

Returns:

provider product type

Return type:

str

query(product_type: str | None = None, items_per_page: int = 20, page: int = 1, count: bool = True, **kwargs: Any) Tuple[List[EOProduct], int | None][source]#

Implementation of how the products must be searched goes here.

This method must return a tuple with (1) a list of EOProduct instances (see eodag.api.product module) which will be processed by a Download plugin (2) and the total number of products matching the search criteria. If count is False, the second element returned must be None.

This table lists all the search plugins currently available:

eodag.plugins.search.qssearch.QueryStringSearch(...)

A plugin that helps implementing any kind of search protocol that relies on query strings (e.g: opensearch).

eodag.plugins.search.qssearch.AwsSearch(...)

A specialisation of RestoSearch that modifies the way the EOProducts are built from the search results

eodag.plugins.search.qssearch.ODataV4Search(...)

A specialisation of a QueryStringSearch that does a two step search to retrieve all products metadata

eodag.plugins.search.qssearch.PostJsonSearch(...)

A specialisation of a QueryStringSearch that uses POST method

eodag.plugins.search.qssearch.StacSearch(...)

A specialisation of a QueryStringSearch that uses generic STAC configuration

eodag.plugins.search.static_stac_search.StaticStacSearch(...)

Static STAC Catalog search plugin

eodag.plugins.search.build_search_result.BuildSearchResult(...)

BuildSearchResult search plugin.

eodag.plugins.search.build_search_result.BuildPostSearchResult(...)

BuildPostSearchResult search plugin.

eodag.plugins.search.csw.CSWSearch(provider, ...)

A plugin for implementing search based on OGC CSW