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:
url : str, mandatory if no host is specified, default None

TAP URL

host : str, optional, default None

host name

server_context : str, optional, default None

server context

tap_context : str, optional, default None

tap context

port : int, optional, default ‘80’

HTTP port

sslport : int, optional, default ‘443’

HTTPS port

default_protocol_is_https : bool, 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.

verbose : bool, 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:
query : str, mandatory

query to be executed

output_file : str, 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_format : str, optional, default ‘votable’

results format

verbose : bool, optional, default ‘False’

flag to display information about the process

dump_to_file : bool, 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:
query : str, mandatory

query to be executed

output_file : str, 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_format : str, optional, default ‘votable’

results format

verbose : bool, optional, default ‘False’

flag to display information about the process

dump_to_file : bool, optional, default ‘False’

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

background : bool, 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:
verbose : bool, 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:
jobid : str, mandatory if no name is provided, default None

job identifier

name : str, mandatory if no jobid is provided, default None

job name

verbose : bool, optional, default ‘False’

flag to display information about the process

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

Loads all public tables

Parameters:
verbose : bool, 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:
job : Job, mandatory

job

verbose : bool, optional, default ‘False’

flag to display information about the process