seagrid.download.http_server#

Legacy HTTP download helper, kept for the 2.x series.

Use seagrid.download.http.fetch() instead.

Functions

retrieve(url, local_filename[, payload, ...])

Download url to local_filename, replacing any existing file.

seagrid.download.http_server.retrieve(url, local_filename, payload=None, get_kws=None, download_timeout=30, progress_bar=True, progress_description=None)[source]#

Download url to local_filename, replacing any existing file.

Parameters:
  • url (str) – Full URL of the file.

  • local_filename (str) – Destination path.

  • payload (dict, optional) – Request body, passed as data to requests.Session.get().

  • get_kws (dict, optional) – Extra keyword arguments for the request (e.g. {"verify": False}).

  • download_timeout (int, optional) – Seconds to wait for the server.

  • progress_bar (bool, optional) – Show a progress bar.

  • progress_description (str, optional) – Label of the progress bar.

Raises:

seagrid.download.DownloadError – If the download fails.

Return type:

None