API Plugins#
Api plugins must inherit the following class and implement query() and download():
- class eodag.plugins.apis.base.Api(provider, config)[source]#
Plugins API Base plugin
An Api plugin inherits the methods from Search and Download plugins.
There are three methods that it must implement:
query: search for productsdownload: download a singleEOProductdownload_all: download multiple products from aSearchResult
The download methods must:
download data in the
output_dirfolder defined in the plugin’s configuration or passed through kwargsextract products from their archive (if relevant) if
extractis set toTrue(Trueby default)save a product in an archive/directory (in
output_dir) whose name must be the product’stitlepropertyupdate the product’s
locationattribute 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
output_dir/.downloadedwhose name is built on the MD5 hash of the product’sproduct_typeandproperties['id']attributes (hashlib.md5((product.product_type+"-"+product.properties['id']).encode("utf-8")).hexdigest()) and whose content is the product’sremote_locationattribute itself.not try to download a product whose
locationattribute already points to an existing file/directorynot 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)
This table lists all the api plugins currently available:
|
A plugin that enables to query and download data on the USGS catalogues |
|
A plugin that enables to build download-request and download data on ECMWF MARS. |