Drivers#

Drivers enable additional methods to be called on the EOProduct. They are set as driver attribute of the EOProduct during its initialization, using some criteria to determine the most adapted driver. The first driver having its associated criteria matching will be used. If no driver is found, the NoDriver criteria is used.

Criteria#

class eodag.api.product.drivers.DriverCriteria[source]#

Driver criteria definition

criteria: list[Callable[..., bool]]#

Function that returns True if the driver is suitable for the given EOProduct

driver: DatasetDriver#

driver to use

eodag.api.product.drivers.DRIVERS: list[DriverCriteria]#

list of drivers and their criteria

eodag.api.product.drivers.LEGACY_DRIVERS: list[DriverCriteria]#

list of legacy drivers and their criteria

Methods available#

class eodag.api.product.drivers.base.DatasetDriver[source]#

Parent class for all dataset drivers.

Drivers will provide methods adapted to a given EOProduct related to predefined criteria.

legacy: DatasetDriver#

legacy driver for deprecated get_data() method usage

ASSET_KEYS_PATTERNS_ROLES: list[AssetPatterns] = []#

list of patterns to match asset keys and roles

STRIP_SPECIAL_PATTERN = re.compile('^[^A-Z0-9]+|[^A-Z0-9]+$', re.IGNORECASE)#

strip non-alphanumeric characters at the beginning and end of the key

guess_asset_key_and_roles(href, eo_product)[source]#

Guess the asset key and roles from the given href.

Parameters:
  • href (str) – The asset href

  • eo_product (EOProduct) – The product to which the asset belongs

Return type:

tuple[str | None, list[str] | None]

Returns:

The asset key and roles

get_data_address(eo_product, band)[source]#

Retrieve the address of the dataset represented by eo_product.

Parameters:
  • eo_product (EOProduct) – The product whom underlying dataset address is to be retrieved

  • band (str) – The band to retrieve (e.g: ‘B01’)

Return type:

str

Returns:

An address for the dataset

Raises:

AddressNotFound

Raises:

UnsupportedDatasetAddressScheme

Deprecated since version 3.1.0: Method used by deprecated get_data()

class eodag.api.product.drivers.base.AssetPatterns[source]#

Asset patterns definition

pattern: Pattern#

pattern to match and extract asset key

roles: list[str]#

roles associated to the asset key

Drivers Available#

EODAG currently advertises the following drivers:

base.NoDriver()

A default legacy driver that does not implement any of the methods it should implement, used for all product types for which the deprecated get_data() method is not implemented.

generic.GenericDriver()

Generic default Driver

sentinel1.Sentinel1Driver()

Driver for Sentinel1 products

sentinel2.Sentinel2Driver()

Driver for Sentinel2 products