TAPService¶
-
class
pyvo.dal.tap.
TAPService
(baseurl)[source]¶ Bases:
pyvo.dal.query.DALService
a representation of a Table Access Protocol service
instantiate a Tablee Access Protocol service
Parameters: baseurl : str
the base URL that should be used for forming queries to the service.
Attributes Summary
availability
returns availability as a tuple in the following form: available
True if the service is available, False otherwise capabilities
returns capabilities as a nested dictionary hardlimit
the hard output limit. maxrec
the default output limit. tables
returns tables as a flat OrderedDict up_since
datetime the service was started upload_methods
a list of upload methods in form of IVOA identifiers Methods Summary
create_query
([query, mode, language, ...])create a query object that constraints can be added to and then run_async
(query[, language, maxrec, uploads])runs async query and returns its result run_sync
(query[, language, maxrec, uploads])runs sync query and returns its result search
(query[, language, maxrec, uploads])runs sync query and returns its result submit_job
(query[, language, maxrec, uploads])submit a async query without starting it and returns a AsyncTAPJob Attributes Documentation
-
availability
¶ returns availability as a tuple in the following form:
Returns: [0] : bool
whether the service is available or not
[1] : datetime
the time since the server is running
-
available
¶ True if the service is available, False otherwise
-
capabilities
¶ returns capabilities as a nested dictionary
Known keys include:
outputs_formats
- languages: {
- ‘ADQL-2.0’: {
- ‘features’:
‘ivo://ivoa.net/std/TAPRegExt#features-adqlgeo’: [], ‘ivo://ivoa.net/std/TAPRegExt#features-udf’: [],
}
-
hardlimit
¶ the hard output limit.
Raises: DALServiceError
if the property is not exposed by the service
-
maxrec
¶ the default output limit.
Raises: DALServiceError
if the property is not exposed by the service
-
tables
¶ returns tables as a flat OrderedDict
-
up_since
¶ datetime the service was started
-
upload_methods
¶ a list of upload methods in form of IVOA identifiers
Methods Documentation
-
create_query
(query=None, mode='sync', language='ADQL', maxrec=None, uploads=None, **keywords)[source]¶ create a query object that constraints can be added to and then executed. The input arguments will initialize the query with the given values.
Parameters: baseurl : str
the base URL for the TAP service
query : str
the query string / parameters
mode : str
the query mode (sync | async). default “sync”
language : str
specifies the query language, default ADQL. useful for services which allow to use the backend query language.
maxrec : int
specifies the maximum records to return. defaults to the service default.
uploads : dict
a mapping from table names to objects containing a votable.
-
run_async
(query, language='ADQL', maxrec=None, uploads=None, **keywords)[source]¶ runs async query and returns its result
Parameters: query : str, dict
the query string / parameters
language : str
specifies the query language, default ADQL. useful for services which allow to use the backend query language.
maxrec : int
specifies the maximum records to return. defaults to the service default
uploads : dict
a mapping from table names to file like objects containing a votable
Returns: TAPResult
the query 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
See also
-
run_sync
(query, language='ADQL', maxrec=None, uploads=None, **keywords)[source]¶ runs sync query and returns its result
Parameters: query : str
The query
language : str
specifies the query language, default ADQL. useful for services which allow to use the backend query language.
maxrec : int
specifies the maximum records to return. defaults to the service default
uploads : dict
a mapping from table names to file like objects containing a votable
Returns: TAPResults
the query result
See also
-
search
(query, language='ADQL', maxrec=None, uploads=None, **keywords)¶ runs sync query and returns its result
Parameters: query : str
The query
language : str
specifies the query language, default ADQL. useful for services which allow to use the backend query language.
maxrec : int
specifies the maximum records to return. defaults to the service default
uploads : dict
a mapping from table names to file like objects containing a votable
Returns: TAPResults
the query result
See also
-
submit_job
(query, language='ADQL', maxrec=None, uploads=None)[source]¶ submit a async query without starting it and returns a AsyncTAPJob object
Parameters: query : str
the query string / parameters
language : str
specifies the query language, default ADQL. useful for services which allow to use the backend query language.
maxrec : int
specifies the maximum records to return. defaults to the service default
uploads : dict
a mapping from table names to file like objects containing a votable
Returns: AsyncTAPJob
the query instance
See also
-