download.sentinelhub_statistical_client

Download process for Sentinel Hub Statistical API

class sentinelhub.download.sentinelhub_statistical_client.SentinelHubStatisticalDownloadClient(*args, n_interval_retries=1, max_retry_threads=5, **kwargs)[source]

Bases: sentinelhub.download.sentinelhub_client.SentinelHubDownloadClient

A special download client for Sentinel Hub Statistical API

Besides a normal download from Sentinel Hub services it implements an additional process of retrying and caching

Parameters:
  • n_interval_retries (int) – Number of retries if a request fails just for a certain timestamp. (This parameter is experimental and might be changed in the future.)
  • max_retry_threads (int) – Number of threads used for retrying. (This parameter is experimental and might be changed in the future.)
download(*args, **kwargs)

The main download method

Parameters:
  • args – Passed to DownloadClient.download
  • kwargs – Passed to DownloadClient.download
get_json(url, post_values=None, headers=None, request_type=None, **kwargs)

Download request as JSON data type

Parameters:
  • url (str) – An URL from where the data will be downloaded
  • post_values (dict or None) – A dictionary of parameters for a POST request
  • headers (dict) – A dictionary of additional request headers
  • request_type (RequestType or None) – A type of HTTP request to make. If not specified, then it will be a GET request if post_values=None and a POST request otherwise
  • kwargs – Any other parameters that are passed to DownloadRequest class
Returns:

JSON data parsed into Python objects

Return type:

dict or list or str or None

get_session()

Provides the session object used by the client

Returns:A Sentinel Hub session object
Return type:SentinelHubSession
get_xml(url, **kwargs)

Download request as XML data type

Parameters:
  • url (str) – url to Sentinel Hub’s services or other sources from where the data is downloaded
  • kwargs – Any other parameters that are passed to DownloadRequest class
Returns:

request response as XML instance

Return type:

XML instance or None