eodag.plugins.apis.usgs.Api

eodag.plugins.apis.usgs.Api

class eodag.plugins.apis.usgs.Api(provider, config)[source]

Plugins API Base plugin

An Api plugin has three download methods that it must implement:

  • query: search for products

  • download: download a single EOProduct

  • download_all: download multiple products from a SearchResult

The download methods must:

  • download data in the outputs_prefix folder defined in the plugin’s configuration or passed through kwargs

  • extract products from their archive (if relevant) if extract is set to True (True by default)

  • save a product in an archive/directory (in outputs_prefix) whose name must be the product’s title property

  • update the product’s location attribute once its data is downloaded (and eventually after it’s extracted) to the product’s location given as a file URI (e.g. ‘file:///tmp/product_folder’ on Linux or ‘file:///C:/Users/username/AppData/LOcal/Temp’ on Windows)

  • save a record file in the directory outputs_prefix/.downloaded whose name is built on the MD5 hash of the product’s remote_location attribute (hashlib.md5(remote_location.encode("utf-8")).hexdigest()) and whose content is the product’s remote_location attribute itself.

  • not try to download a product whose location attribute already points to an existing file/directory

  • not try to download a product if its record file exists as long as the expected product’s file/directory. If the record file only is found, it must be deleted (it certainly indicates that the download didn’t complete)

__init__(provider, config)

Methods

__init__(provider, config)

download(product[, auth, progress_callback, ...])

Base download method.

download_all(products[, auth, ...])

Base download_all method.

query(*args[, count])

Implementation of how the products must be searched goes here.

Attributes

plugins