DALQuery¶
-
class
pyvo.dal.query.
DALQuery
(baseurl, protocol=None, version=None)[source]¶ Bases:
dict
a class for preparing a query to a particular service. Query constraints are added via its service type-specific methods. The various execute() functions will submit the query and return the results.
The base URL for the query can be changed via the baseurl property.
initialize the query object with a baseurl
Attributes Summary
baseurl
the base URL that this query will be sent to when one of the protocol
The service protocol supported by this query object (read-only). std_parameters
version
The version of the service protocol supported by this query object (read-only). Methods Summary
execute
()submit the query and return the results as a Results subclass instance execute_raw
()submit the query and return the raw VOTable XML as a string. execute_stream
()submit the query and return the raw VOTable XML as a file stream execute_votable
()submit the query and return the results as an AstroPy votable instance getqueryurl
()return the GET URL that encodes the current query. This is the submit
()does the actual request Attributes Documentation
-
baseurl
¶ the base URL that this query will be sent to when one of the execute functions is called.
-
protocol
¶ The service protocol supported by this query object (read-only).
-
std_parameters
= []¶
-
version
¶ The version of the service protocol supported by this query object (read-only).
Methods Documentation
-
execute
()[source]¶ submit the query and return the results as a Results subclass instance
Raises: DALServiceError
for errors connecting to or communicating with the service
DALQueryError
for errors either in the input query syntax or other user errors detected by the service
DALFormatError
for errors parsing the VOTable response
-
execute_raw
()[source]¶ submit the query and return the raw VOTable XML as a string.
Raises: DALServiceError
for errors connecting to or communicating with the service
DALQueryError
for errors in the input query syntax
-
execute_stream
()[source]¶ submit the query and return the raw VOTable XML as a file stream
Raises: DALServiceError
for errors connecting to or communicating with the service
DALQueryError
for errors in the input query syntax
-
execute_votable
()[source]¶ submit the query and return the results as an AstroPy votable instance
Returns: astropy.io.votable.tree.Table
an Astropy votable Table instance
Raises: DALServiceError
for errors connecting to or communicating with the service
DALFormatError
for errors parsing the VOTable response
DALQueryError
for errors in the input query syntax
See also
astropy.io.votable
,DALServiceError
,DALFormatError
,DALQueryError
-
getqueryurl
()[source]¶ return the GET URL that encodes the current query. This is the URL that the execute functions will use if called next.
Parameters: lax : bool
if False (default), a DALQueryError exception will be raised if the current set of parameters cannot be used to form a legal query. This implementation does no syntax checking; thus, this argument is ignored.
Returns: str
the encoded query URL
Raises: DALQueryError
when lax=False, for errors in the input query syntax
See also
-