Search Plugins#

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

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

Base Search Plugin.

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

  • config (PluginConfig) – An EODAG plugin configuration

build_sort_by(sort_by_arg)[source]#

Build the sorting part of the query string or body by transforming the sort_by argument into a provider-specific string or dictionary

Parameters:

sort_by_arg (list[tuple[str, str]]) – the sort_by argument in EODAG format

Return type:

tuple[str, dict[str, list[dict[str, str]]]]

Returns:

The sort_by argument in provider-specific format

clear()[source]#

Method used to clear a search context between two searches.

Return type:

None

discover_product_types(**kwargs)[source]#

Fetch product types list from provider using discover_product_types conf

Parameters:

kwargs (Any)

Return type:

dict[str, Any] | None

discover_queryables(**kwargs)[source]#

Fetch queryables list from provider using discover_queryables conf

Parameters:

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

Return type:

dict[str, Any] | None

Returns:

fetched queryable parameters dict

get_assets_from_mapping(provider_item)[source]#

Create assets based on the assets_mapping in the provider’s config and an item returned by the provider

Parameters:

provider_item (dict[str, Any]) – dict of item properties returned by the provider

Return type:

dict[str, Any]

Returns:

dict containing the asset metadata

get_metadata_mapping(product_type=None)[source]#

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

Parameters:

product_type (str | None, default: None) – the desired product type

Return type:

dict[str, str | list[str]]

Returns:

The product type specific metadata-mapping

get_product_type_cfg_value(key, default=None)[source]#

Get the value of a configuration option specific to the current product type.

This method retrieves the value of a configuration option from the product_type_config attribute. If the option is not found, the provided default value is returned.

Parameters:
  • key (str) – The configuration option key.

  • default (Any) – The default value to be returned if the option is not found (default is None).

Returns:

The value of the specified configuration option or the default value.

Return type:

Any

get_product_type_def_params(product_type, format_variables=None)[source]#

Get the provider product type definition parameters and specific settings

Parameters:
  • product_type (str) – the desired product type

  • format_variables (dict[str, Any] | None, default: None)

Return type:

dict[str, Any]

Returns:

The product type definition parameters

get_sort_by_arg(kwargs)[source]#

Extract the sort_by argument from the kwargs or the provider default sort configuration

Parameters:

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

Return type:

list[tuple[str, str]] | None

Returns:

The sort_by argument from the kwargs or the provider default sort configuration

list_queryables(filters, available_product_types, product_type_configs, product_type=None, alias=None)[source]#

Get queryables

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

  • available_product_types (list[Any]) – list of available product types

  • product_type_configs (dict[str, dict[str, Any]]) – dict containing the product type information for all used product types

  • product_type (str | None, default: None) – (optional) The product type.

  • alias (str | None, default: None) – (optional) alias of the product type

Return type:

QueryablesDict

Returns:

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

map_product_type(product_type, **kwargs)[source]#

Get the provider product type from eodag product type

Parameters:
  • product_type (str | None) – eodag product type

  • kwargs (Any)

Return type:

str | None

Returns:

provider product type

query(prep=PreparedSearch(product_type=None, page=1, items_per_page=20, auth=None, auth_plugin=None, count=True, url=None, info_message=None, exception_message=None), **kwargs)[source]#

Implementation of how the products must be searched goes here.

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

Parameters:
  • prep (PreparedSearch, default: PreparedSearch(product_type=None, page=1, items_per_page=20, auth=None, auth_plugin=None, count=True, url=None, info_message=None, exception_message=None))

  • kwargs (Any)

Return type:

tuple[list[EOProduct], int | None]

queryables_from_metadata_mapping(product_type=None, alias=None)[source]#

Extract queryable parameters from product type metadata mapping. :type product_type: str | None, default: None :param product_type: product type id (optional) :type alias: str | None, default: None :param alias: (optional) alias of the product type :rtype: dict[str, Any] :returns: dict of annotated queryables

validate(search_params, auth)[source]#

Validate a search request.

Parameters:
  • search_params (dict[str, Any]) – Arguments of the search request

  • auth (AuthBase | S3ServiceResource | None) – Authentication object

Raises:

ValidationError

Return type:

None

This table lists all the search plugins currently available:

qssearch.QueryStringSearch(provider, config)

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

qssearch.ODataV4Search(provider, config)

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

qssearch.PostJsonSearch(provider, config)

A specialisation of a QueryStringSearch that uses POST method

qssearch.StacSearch(provider, config)

A specialisation of PostJsonSearch that uses generic STAC configuration, it therefore has the same configuration parameters (those inherited from QueryStringSearch).

qssearch.WekeoSearch(provider, config)

A specialisation of a PostJsonSearch that uses generic STAC configuration for queryables (inherited from StacSearch).

static_stac_search.StaticStacSearch(...)

Static STAC Catalog search plugin

stac_list_assets.StacListAssets(provider, config)

StacListAssets is an extension of StacSearch.

cop_marine.CopMarineSearch(provider, config)

class that implements search for the Copernicus Marine provider

creodias_s3.CreodiasS3Search(provider, config)

CreodiasS3Search is an extension of ODataV4Search, it executes a Search on creodias and adapts results so that the assets contain links to s3.

build_search_result.ECMWFSearch(provider, config)

ECMWF search plugin.

build_search_result.MeteoblueSearch(...)

MeteoblueSearch search plugin.

build_search_result.WekeoECMWFSearch(...)

WekeoECMWFSearch search plugin.

csw.CSWSearch(provider, config)

A plugin for implementing search based on OGC CSW