DALQuery¶
-
class
pyvo.dal.query.
DALQuery
(baseurl, **keywords)[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 queryurl
The URL that encodes the current query. 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. 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.
-
queryurl
¶ The URL that encodes the current query. This is the URL that the execute functions will use if called next.
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. No exceptions are raised here because non-2xx responses might still contain payload.
-
execute_votable
()[source]¶ Submit the query and return the results as an AstroPy votable instance. As this is the level where qualified error messages are available, they are raised here instead of in the underlying execute_stream.
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
-