Tap

class astroquery.utils.tap.Tap(url=None, host=None, server_context=None, tap_context=None, port=80, sslport=443, default_protocol_is_https=False, connhandler=None, verbose=False)[source]

Bases: object

TAP class Provides TAP capabilities

Constructor

Parameters
urlstr, mandatory if no host is specified, default None

TAP URL

hoststr, optional, default None

host name

server_contextstr, optional, default None

server context

tap_contextstr, optional, default None

tap context

portint, optional, default ‘80’

HTTP port

sslportint, optional, default ‘443’

HTTPS port

default_protocol_is_httpsbool, optional, default False

Specifies whether the default protocol to be used is HTTPS

connhandler connection handler object, optional, default None

HTTP(s) connection hander (creator). If no handler is provided, a new one is created.

verbosebool, optional, default ‘False’

flag to display information about the process

Methods Summary

launch_job(query[, name, output_file, …])

Launches a synchronous job

launch_job_async(query[, name, output_file, …])

Launches an asynchronous job

list_async_jobs([verbose])

Returns all the asynchronous jobs

load_async_job([jobid, name, verbose])

Loads an asynchronous job

load_tables([verbose])

Loads all public tables

save_results(job[, verbose])

Saves job results

Methods Documentation

launch_job(query, name=None, output_file=None, output_format='votable', verbose=False, dump_to_file=False, upload_resource=None, upload_table_name=None)[source]

Launches a synchronous job

Parameters
querystr, mandatory

query to be executed

output_filestr, optional, default None

file name where the results are saved if dumpToFile is True. If this parameter is not provided, the jobid is used instead

output_formatstr, optional, default ‘votable’

results format

verbosebool, optional, default ‘False’

flag to display information about the process

dump_to_filebool, optional, default ‘False’

if True, the results are saved in a file instead of using memory

upload_resource: str, optional, default None

resource to be uploaded to UPLOAD_SCHEMA

upload_table_name: str, required if uploadResource is provided, default None

resource temporary table name associated to the uploaded resource

Returns
A Job object
launch_job_async(query, name=None, output_file=None, output_format='votable', verbose=False, dump_to_file=False, background=False, upload_resource=None, upload_table_name=None)[source]

Launches an asynchronous job

Parameters
querystr, mandatory

query to be executed

output_filestr, optional, default None

file name where the results are saved if dumpToFile is True. If this parameter is not provided, the jobid is used instead

output_formatstr, optional, default ‘votable’

results format

verbosebool, optional, default ‘False’

flag to display information about the process

dump_to_filebool, optional, default ‘False’

if True, the results are saved in a file instead of using memory

backgroundbool, optional, default ‘False’

when the job is executed in asynchronous mode, this flag specifies whether the execution will wait until results are available

upload_resource: str, optional, default None

resource to be uploaded to UPLOAD_SCHEMA

upload_table_name: str, required if uploadResource is provided, default None

resource temporary table name associated to the uploaded resource

Returns
A Job object
list_async_jobs(verbose=False)[source]

Returns all the asynchronous jobs

Parameters
verbosebool, optional, default ‘False’

flag to display information about the process

Returns
A list of Job objects
load_async_job(jobid=None, name=None, verbose=False)[source]

Loads an asynchronous job

Parameters
jobidstr, mandatory if no name is provided, default None

job identifier

namestr, mandatory if no jobid is provided, default None

job name

verbosebool, optional, default ‘False’

flag to display information about the process

Returns
A Job object
load_tables(verbose=False)[source]

Loads all public tables

Parameters
verbosebool, optional, default ‘False’

flag to display information about the process

Returns
A list of table objects
save_results(job, verbose=False)[source]

Saves job results

Parameters
jobJob, mandatory

job

verbosebool, optional, default ‘False’

flag to display information about the process