BaseQueryResponse#
- class sunpy.net.base_client.BaseQueryResponse[source]#
Bases:
Sequence
An Abstract Base Class for results returned from BaseClient.
Notes
A QueryResponse object must be able to be instantiated with only one iterable argument. (i.e. the
__init__
must only have one required argument).The
client
property must be settable.The base class does not prescribe how you store the results from your client, only that it must be possible to represent them as an astropy table in the
build_table
method.__getitem__
must return an instance of the type it was called on. I.e. it must always return an object oftype(self)
.
Attributes Summary
A
collections.abc.Sequence
object which contains the records contained within the Query Response.An instance of
BaseClient
used to generate the results.Methods Summary
Return an
astropy.table.Table
representation of the query response.Returns a set of class attributes on all the response blocks.
show
(*cols)Returns response tables with desired columns for the Query.
Attributes Documentation
- blocks#
A
collections.abc.Sequence
object which contains the records contained within the Query Response.
- client#
An instance of
BaseClient
used to generate the results.Generally this is used to fetch the results later.
Note
In general, this doesn’t have to be the same instance of
BaseClient
, this is left to the client developer. If there is a significant connection overhead in creating an instance of a client you might want it to be the same instance as used for the search.
Methods Documentation
- abstract build_table()[source]#
Return an
astropy.table.Table
representation of the query response.
- response_block_properties()[source]#
Returns a set of class attributes on all the response blocks.
- Returns:
s (
set
) – List of strings, containing attribute names in the response blocks.
- show(*cols)[source]#
Returns response tables with desired columns for the Query.
- Parameters:
*cols (
tuple
) – Name of columns to be shown.- Returns:
astropy.table.Table
– A table showing values for specified columns.