TapPlus

class astroquery.utils.tap.TapPlus(url=None, host=None, server_context=None, tap_context=None, port=80, sslport=443, default_protocol_is_https=False, connhandler=None, upload_context=None, table_edit_context=None, data_context=None, datalink_context=None, verbose=True)[source]

Bases: astroquery.utils.tap.Tap

TAP plus class Provides TAP and 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

upload_context : str, optional, default None

upload context

table_edit_context : str, optional, default None

context for all actions to be performed over a existing table

data_context : str, optional, default None

data context

datalink_context : str, optional, default None

datalink 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 ‘True’

flag to display information about the process

Methods Summary

delete_user_table([table_name, …])

Removes a user table

get_datalinks(ids[, verbose])

Gets datalinks associated to the provided identifiers

is_valid_user([user_id, verbose])

Determines if the specified user exists in the system TAP+ only

load_data([params_dict, output_file, verbose])

Loads the specified data

load_group([group_name, verbose])

Load group with title being group_name

load_groups([verbose])

Loads groups

load_shared_items([verbose])

Loads shared items

load_tables([only_names, …])

Loads all public tables

login([user, password, credentials_file, …])

Performs a login.

login_gui([verbose])

Performs a login using a GUI dialog

logout([verbose])

Performs a logout

remove_jobs(jobs_list[, verbose])

Removes the specified jobs

search_async_jobs([jobfilter, verbose])

Searches for jobs applying the specified filter

set_ra_dec_columns([table_name, …])

Set columns of a table as ra and dec respectively a user table

share_group_add_user([group_name, user_id, …])

Adds user to a group

share_group_create([group_name, …])

Creates a group

share_group_delete([group_name, verbose])

Deletes a group

share_group_delete_user([group_name, …])

Deletes user from a group

share_table([group_name, table_name, …])

Shares a table with a group

share_table_stop([group_name, table_name, …])

Stop sharing a table

update_user_table([table_name, …])

Updates a user table

upload_table([upload_resource, table_name, …])

Uploads a table to the user private space

upload_table_from_job([job, table_name, …])

Creates a table to the user private space from a job

Methods Documentation

delete_user_table(table_name=None, force_removal=False, verbose=False)[source]

Removes a user table

Parameters

table_name : str, required

table to be removed

force_removal : bool, optional, default ‘False’

flag to indicate if removal should be forced

verbose : bool, optional, default ‘False’

flag to display information about the process

Gets datalinks associated to the provided identifiers

Parameters

ids : str list, mandatory

list of identifiers

verbose : bool, optional, default ‘False’

flag to display information about the process

Returns

A table object

is_valid_user(user_id=None, verbose=False)[source]

Determines if the specified user exists in the system TAP+ only

Parameters

user_id : str, mandatory

user id to be checked

verbose : bool, optional, default ‘False’

flag to display information about the process

Returns

Boolean indicating if the specified user exists

load_data(params_dict=None, output_file=None, verbose=False)[source]

Loads the specified data

Parameters

params_dict : dictionary, mandatory

list of request parameters

output_file : string, optional, default None

file where the results are saved. If it is not provided, the http response contents are returned.

verbose : bool, optional, default ‘False’

flag to display information about the process

Returns

A table object if output_file is None.

None if output_file is not None.

load_group(group_name=None, verbose=False)[source]

Load group with title being group_name

Parameters

group_name : str, required

group to be loaded

verbose : bool, optional, default ‘False’

flag to display information about the process

Returns

A group with title being group_name

load_groups(verbose=False)[source]

Loads groups

Parameters

verbose : bool, optional, default ‘False’

flag to display information about the process

Returns

A set of groups of a user

load_shared_items(verbose=False)[source]

Loads shared items

Parameters

verbose : bool, optional, default ‘False’

flag to display information about the process

Returns

A set of shared items

load_tables(only_names=False, include_shared_tables=False, verbose=False)[source]

Loads all public tables

Parameters

only_names : bool, TAP+ only, optional, default ‘False’

True to load table names only

include_shared_tables : bool, TAP+, optional, default ‘False’

True to include shared tables

verbose : bool, optional, default ‘False’

flag to display information about the process

Returns

A list of table objects

login(user=None, password=None, credentials_file=None, verbose=False)[source]

Performs a login. User and password arguments can be used or a file that contains user name and password (2 lines: one for user name and the following one for the password). If no arguments are provided, a prompt asking for user name and password will appear.

Parameters

user : str, default None

login name

password : str, default None

user password

credentials_file : str, default None

file containing user and password in two lines

verbose : bool, optional, default ‘False’

flag to display information about the process

login_gui(verbose=False)[source]

Performs a login using a GUI dialog

Parameters

verbose : bool, optional, default ‘False’

flag to display information about the process

logout(verbose=False)[source]

Performs a logout

Parameters

verbose : bool, optional, default ‘False’

flag to display information about the process

remove_jobs(jobs_list, verbose=False)[source]

Removes the specified jobs

Parameters

jobs_list : str, mandatory

jobs identifiers to be removed

verbose : bool, optional, default ‘False’

flag to display information about the process

search_async_jobs(jobfilter=None, verbose=False)[source]

Searches for jobs applying the specified filter

Parameters

jobfilter : JobFilter, optional, default None

job filter

verbose : bool, optional, default ‘False’

flag to display information about the process

Returns

A list of Job objects

set_ra_dec_columns(table_name=None, ra_column_name=None, dec_column_name=None, verbose=False)[source]

Set columns of a table as ra and dec respectively a user table

Parameters

table_name : str, required

table to be set

ra_column_name : str, required

ra column to be set

dec_column_name : str, required

dec column to be set

verbose : bool, optional, default ‘False’

flag to display information about the process

share_group_add_user(group_name=None, user_id=None, verbose=False)[source]

Adds user to a group

Parameters

group_name : str, required

group which user_id will be added in

user_id : str, required

user id to be added

verbose : bool, optional, default ‘False’

flag to display information about the process

share_group_create(group_name=None, description=None, verbose=False)[source]

Creates a group

Parameters

group_name : str, required

group to be created

description : str, required

description of the group

verbose : bool, optional, default ‘False’

flag to display information about the process

share_group_delete(group_name=None, verbose=False)[source]

Deletes a group

Parameters

group_name : str, required

group to be created

verbose : bool, optional, default ‘False’

flag to display information about the process

share_group_delete_user(group_name=None, user_id=None, verbose=False)[source]

Deletes user from a group

Parameters

group_name : str, required

group which user_id will be removed from

user_id : str, required

user id to be deleted

verbose : bool, optional, default ‘False’

flag to display information about the process

share_table(group_name=None, table_name=None, description=None, verbose=False)[source]

Shares a table with a group

Parameters

group_name : str, required

group in which table will be shared

table_name : str, required

table to be shared

description : str, required

description of the sharing

verbose : bool, optional, default ‘False’

flag to display information about the process

share_table_stop(group_name=None, table_name=None, verbose=False)[source]

Stop sharing a table

Parameters

group_name : str, required

group where the table is shared to

table_name : str, required

table to be stopped from being shared

verbose : bool, optional, default ‘False’

flag to display information about the process

update_user_table(table_name=None, list_of_changes=[], verbose=False)[source]

Updates a user table

Parameters

table_name : str, required

table to be updated

list_of_changes : list, required

list of lists, each one of them containing sets of [column_name, field_name, value]. column_name is the name of the column to be updated field_name is the name of the tap field to be modified field name can be ‘utype’, ‘ucd’, ‘flags’ or ‘indexed’ value is the new value this field of this column will take

verbose : bool, optional, default ‘False’

flag to display information about the process

upload_table(upload_resource=None, table_name=None, table_description=None, format=None, verbose=False)[source]

Uploads a table to the user private space

Parameters

upload_resource : object, mandatory

table to be uploaded: pyTable, file or URL.

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

resource temporary table name associated to the uploaded resource

table_description : str, optional, default None

table description

format : str, optional, default ‘VOTable’

resource format

verbose : bool, optional, default ‘False’

flag to display information about the process

upload_table_from_job(job=None, table_name=None, table_description=None, verbose=False)[source]

Creates a table to the user private space from a job

Parameters

job: job, mandatory

job used to create a table. Could be a string with the jobid or a job itself

table_name : str, default ‘t’+jobid

resource temporary table name associated to the uploaded resource

table_description : str, optional, default None

table description

verbose : bool, optional, default ‘False’

flag to display information about the process