GenericClient

class sunpy.net.dataretriever.GenericClient[source] [edit on github]

Bases: object

Base class for simple web clients for the data retriever module. This class is mainly designed for downloading data from FTP and HTTP type data sources, although should in theory be general enough to get data from any web service.

This class has two user facing methods query and get the former generates a set of results for files available through the service the client is querying and the latter downloads that data.

The query method takes a set of sunpy.net.attrs objects and then converts these into a call to _get_url_for_timerange. It does this through the map_ dictionary which represents the attrs objects as a dictionary.

Methods Summary

fetch(qres[, path, error_callback]) Download a set of results.
get(qres[, path, error_callback])

Deprecated since version 0.8.

query(*query, **kwargs)

Deprecated since version 0.8.

search(*args, **kwargs) Query this client for a list of results.

Methods Documentation

fetch(qres, path=None, error_callback=None, **kwargs)[source] [edit on github]

Download a set of results.

Parameters:
  • qres (QueryResponse) – Results to download.
  • path (string or pathlib.Path) – Path to the download directory
  • error_callback (Function) – Callback function for error during downloads
Returns:

Results Object

get(qres, path=None, error_callback=None, **kwargs)[source] [edit on github]

Deprecated since version 0.8: The get function is deprecated and may be removed in a future version. Use GenericClient.fetch instead.

See fetch

query(*query, **kwargs)[source] [edit on github]

Deprecated since version 0.8: The query function is deprecated and may be removed in a future version. Use GenericClient.search instead.

See search

search(*args, **kwargs)[source] [edit on github]

Query this client for a list of results.

Parameters:*args (tuple) – sunpy.net.attrs objects representing the query.