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_collections(**kwargs)[source]#

Fetch collections list from provider using discover_collections 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 (collection 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_collection_cfg_dates(start_default=None, end_default=None)[source]#

Get start and end dates from the collection configuration.

Extracts dates from the extent.temporal.interval structure in the collection configuration, falling back to provided defaults if dates are not available.

Parameters:
  • start_default (str | None, default: None) – Default value to return for start date if not found in config

  • end_default (str | None, default: None) – Default value to return for end date if not found in config

Return type:

tuple[str | None, str | None]

Returns:

Tuple of (mission_start_date, mission_end_date) as ISO strings or defaults

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

Get the value of a configuration option specific to the current collection.

This method retrieves the value of a configuration option from the collection_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_collection_def_params(collection, format_variables=None)[source]#

Get the provider collection definition parameters and specific settings

Parameters:
  • collection (str) – the desired collection

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

Return type:

dict[str, Any]

Returns:

The collection definition parameters

get_metadata_mapping(collection=None)[source]#

Get the plugin metadata mapping configuration (collection specific if exists)

Parameters:

collection (str | None, default: None) – the desired collection

Return type:

dict[str, str | list[str]]

Returns:

The collection specific metadata-mapping

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_collections, collection_configs, collection=None, alias=None)[source]#

Get queryables

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

  • available_collections (list[Any]) – list of available collections

  • collection_configs (dict[str, dict[str, Any]]) – dict containing the collection information for all used collections

  • collection (str | None, default: None) – (optional) The collection.

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

Return type:

QueryablesDict

Returns:

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

map_collection(collection, **kwargs)[source]#

Get the provider collection from eodag collection

Parameters:
  • collection (str | None) – eodag collection

  • kwargs (Any)

Return type:

str | None

Returns:

provider collection

query(prep=PreparedSearch(collection=None, page=1, limit=20, auth=None, auth_plugin=None, count=True, url=None, info_message=None, exception_message=None, next_page_token=None, next_page_token_key=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(collection=None, page=1, limit=20, auth=None, auth_plugin=None, count=True, url=None, info_message=None, exception_message=None, next_page_token=None, next_page_token_key=None))

  • kwargs (Any)

Return type:

SearchResult

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

Extract queryable parameters from collection metadata mapping. :type collection: str | None, default: None :param collection: collection id (optional) :type alias: str | None, default: None :param alias: (optional) alias of the collection :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.

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

cop_ghsl.CopGhslSearch(provider, config)

Search plugin to fetch items from Copernicus Global Human Settlement Layer

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