You can run this notebook in a live session with Binder.

Providers and products

from eodag import EODataAccessGateway
dag = EODataAccessGateway()

Providers available

The method available_providers() returns a list of the pre-configured providers.

available_providers = dag.available_providers()
print(f"eodag has {len(available_providers)} providers already configured.")
eodag has 12 providers already configured.

It can take a product type as an argument and will return the providers known to eodag that offer this product.


Product types available

The method list_product_types() returns a dictionary that represents eodag’s internal product type catalog.

catalog = dag.list_product_types()
{'ID': 'CBERS4_AWFI_L2',
 'abstract': 'China-Brazil Earth Resources Satellite, CBERS-4 AWFI camera Level-2 product. System corrected images, expect some\ntranslation error.\n',
 'instrument': 'AWFI',
 'platform': 'CBERS',
 'platformSerialIdentifier': 'CBERS-4',
 'processingLevel': 'L2',
 'keywords': 'AWFI,CBERS,CBERS-4,L2',
 'sensorType': 'OPTICAL',
 'license': 'proprietary',
 'missionStartDate': '2014-12-07T00:00:00Z',
 'title': 'CBERS-4 AWFI Level-2'}
products_id = [p["ID"] for p in catalog]
print(f"EODAG has {len(products_id)} product types stored in its internal catalog.")
EODAG has 53 product types stored in its internal catalog.

The method can take a provider name as an argument and will return the product types known to eodag that are offered by this provider.

peps_products = dag.list_product_types("peps")
[p["ID"] for p in peps_products]
['S1_SAR_GRD', 'S1_SAR_OCN', 'S1_SAR_SLC', 'S2_MSI_L1C', 'S2_MSI_L2A']

Combine these two methods

These two methods can be combined to find which product type is the most common in eodag’s catalog among all the providers.

availability_per_product = []
for product in products_id:
    providers = dag.available_providers(product)
    availability_per_product.append((product, len(providers)))
availability_per_product = sorted(availability_per_product, key=lambda x: x[1], reverse=True)
most_common_p_type, nb_providers = availability_per_product[0]
print(f"The most common product type is '{most_common_p_type}' with {nb_providers} providers offering it.")
The most common product type is 'S2_MSI_L1C' with 8 providers offering it.

These can be also used to find out which provider (as configured by eodag) offers the hights number of different product types.

availability_per_provider = []
for provider in dag.available_providers():
    provider_products_id = [
        for p in dag.list_product_types(provider)
        (provider, len(provider_products_id))
availability_per_provider = sorted(availability_per_provider, key=lambda x: x[1], reverse=True)
provider, nb_p_types = availability_per_provider[0]
print(f"The provider with the largest number of product types is '{provider}' with {nb_p_types}.")
The provider with the largest number of product types is 'onda' with 18.