BaseClient#

class sunpy.net.base_client.BaseClient[source]#

Bases: ABC

This defines the Abstract Base Class for each download client.

The BaseClient has several abstract methods that ensure that any subclass enforces the bare minimum API. These are search, fetch and _can_handle_query. The last one ensures that each download client can be registered with Fido.

Most download clients should subclass GenericClient. If the structure of GenericClient is not useful you should use BaseClient. VSOClient and JSOCClient are examples of download clients that subclass BaseClient.

Attributes Summary

info_url

This should return a string that is a URL to the data server or documentation on the data being served.

Methods Summary

check_attr_types_in_query(query[, ...])

Check a query against required and optional attributes.

fetch(query_results, *, path, downloader, ...)

This enables the user to fetch the data using the client, after a search.

register_values(*query)

This enables the client to register what kind of Attrs it can use directly.

search(*args, **kwargs)

This enables the user to search for data using the client.

Attributes Documentation

info_url#

This should return a string that is a URL to the data server or documentation on the data being served.

Methods Documentation

static check_attr_types_in_query(query, required_attrs={}, optional_attrs={})[source]#

Check a query against required and optional attributes.

Returns True if query contains all the attrs in required_attrs, and if query contains only attrs in both required_attrs and optional_attrs.

abstract fetch(query_results, *, path, downloader, **kwargs)[source]#

This enables the user to fetch the data using the client, after a search.

Parameters:
  • query_results – Results to download.

  • path (str or pathlib.Path, optional) – Path to the download directory

  • downloader (parfive.Downloader) – The download manager to use.

Returns:

parfive.Results – The results object, can be None if wait is False and downloader is not None.

classmethod register_values(*query)[source]#

This enables the client to register what kind of Attrs it can use directly.

Returns:

dict – A dictionary with key values of Attrs and the values are a tuple of (“Attr Type”, “Name”, “Description”).

abstract search(*args, **kwargs)[source]#

This enables the user to search for data using the client.

Must return a subclass of BaseQueryResponse.