TAPService

class pyvo.dal.tap.TAPService(baseurl)[source]

Bases: pyvo.dal.query.DALService, pyvo.dal.mixin.AvailabilityMixin, pyvo.dal.mixin.CapabilityMixin

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

hardlimit the hard output limit.
maxrec the default output limit.
tables returns tables as a flat OrderedDict
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

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

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

AsyncTAPJob

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

TAPResults

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

TAPResults

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

AsyncTAPJob