UsgsApi#
- class eodag.plugins.apis.usgs.UsgsApi(provider, config)[source]#
A plugin that enables to query and download data on the USGS catalogues
- Parameters:
provider (
str) – provider nameconfig (
PluginConfig) –Api plugin configuration:
type(str) (mandatory): UsgsApipagination(Pagination) (mandatory): object containing parameters for pagination; should contain the attributetotal_items_nb_key_pathwhich is indicating the key for the number of total items in the provider resultssl_verify(bool): if the ssl certificates should be verified in the download request; default:Trueneed_auth(bool): if authentication is required for search; default:Falseextract(bool): if the content of the downloaded file should be extracted; default:Trueorder_enabled(bool): if the product has to be ordered to download it; default:Falsemetadata_mapping(dict[str, Union[str, list]]): how parameters should be mapped between the provider and eodag; If a string is given, this is the mapping parameter returned by provider -> eodag parameter. If a list with 2 elements is given, the first one is the mapping eodag parameter -> provider query parameters and the second one the mapping provider result parameter -> eodag parameter
- __init__(provider, config)[source]#
- Parameters:
provider (
str)config (
PluginConfig)
Methods
__init__(provider, config)authenticate()Login to usgs api
build_sort_by(sort_by_arg)Build the sorting part of the query string or body by transforming the
sort_byargument into a provider-specific string or dictionaryclear()Method used to clear a search context between two searches.
discover_product_types(**kwargs)Fetch product types list from provider using discover_product_types conf
discover_queryables(**kwargs)Fetch queryables list from provider using
discover_queryablesconfdownload(product[, auth, progress_callback, ...])Download data from USGS catalogues
download_all(products[, auth, ...])Download all using parent (base plugin) method
generate_record_hash(product)Generate the record hash of the given product.
get_assets_from_mapping(provider_item)Create assets based on the assets_mapping in the provider's config and an item returned by the provider
get_metadata_mapping([product_type])Get the plugin metadata mapping configuration (product type specific if exists)
get_product_type_cfg_value(key[, default])Get the value of a configuration option specific to the current product type.
get_product_type_def_params(product_type[, ...])Get the provider product type definition parameters and specific settings
get_sort_by_arg(kwargs)Extract the
sort_byargument from the kwargs or the provider default sort configurationlist_queryables(filters, ...[, ...])Get queryables
map_product_type(product_type, **kwargs)Get the provider product type from eodag product type
query([prep])Search for data on USGS catalogues
queryables_from_metadata_mapping([...])Extract queryable parameters from product type metadata mapping.
validate(search_params, auth)Validate a search request.
Attributes
pluginsauthnext_page_urlnext_page_query_objtotal_items_nbneed_count