download.sentinelhub_client

Module implementing a rate-limited multi-threaded download client for downloading from Sentinel Hub service

class sentinelhub.download.sentinelhub_client.SentinelHubDownloadClient(*, session=None, **kwargs)[source]

Bases: sentinelhub.download.client.DownloadClient

Download client specifically configured for download from Sentinel Hub service

Parameters:
  • session (SentinelHubSession or None) – An OAuth2 session with Sentinel Hub service
  • kwargs – Optional parameters from DownloadClient
download(*args, **kwargs)[source]

The main download method

Parameters:
  • args – Passed to DownloadClient.download
  • kwargs – Passed to DownloadClient.download
get_session()[source]

Provides the session object used by the client

Returns:A Sentinel Hub session object
Return type:SentinelHubSession
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_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