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=False)[source]¶
Bases:
Tap
TAP plus class Provides TAP and 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
- upload_contextstr, optional, default None
upload context
- table_edit_contextstr, optional, default None
context for all actions to be performed over a existing table
- data_contextstr, optional, default None
data context
- datalink_contextstr, optional, default None
datalink 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
- connhandlerconnection handler object, optional, default None
HTTP(s) connection hander (creator). If no handler is provided, a new one is created.
- verbosebool, 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
get_table_update_arguments
(table_name, ...)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_namestr, required
table to be removed
- force_removalbool, optional, default ‘False’
flag to indicate if removal should be forced
- verbosebool, optional, default ‘False’
flag to display information about the process
- get_datalinks(ids, verbose=False)[source]¶
Gets datalinks associated to the provided identifiers
- Parameters:
- idsstr list, mandatory
list of identifiers
- verbosebool, optional, default ‘False’
flag to display information about the process
- Returns:
- A table object
- static get_new_column_values_for_update(list_of_changes, column_name, c_flags, c_indexed, c_ucd, c_utype)[source]¶
- is_valid_user(user_id=None, verbose=False)[source]¶
Determines if the specified user exists in the system TAP+ only
- Parameters:
- user_idstr, mandatory
user id to be checked
- verbosebool, 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_dictdictionary, mandatory
list of request parameters
- output_filestring, optional, default None
file where the results are saved. If it is not provided, the http response contents are returned.
- verbosebool, 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_namestr, required
group to be loaded
- verbosebool, 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:
- verbosebool, optional, default ‘False’
flag to display information about the process
- Returns:
- A set of groups of a user
Loads shared items
- Parameters:
- verbosebool, 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_namesbool, TAP+ only, optional, default ‘False’
True to load table names only
- include_shared_tablesbool, TAP+, optional, default ‘False’
True to include shared tables
- verbosebool, 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:
- userstr, default None
login name
- passwordstr, default None
user password
- credentials_filestr, default None
file containing user and password in two lines
- verbosebool, optional, default ‘False’
flag to display information about the process
- login_gui(verbose=False)[source]¶
Performs a login using a GUI dialog
- Parameters:
- verbosebool, optional, default ‘False’
flag to display information about the process
- logout(verbose=False)[source]¶
Performs a logout
- Parameters:
- verbosebool, optional, default ‘False’
flag to display information about the process
- remove_jobs(jobs_list, verbose=False)[source]¶
Removes the specified jobs
- Parameters:
- jobs_liststr, mandatory
jobs identifiers to be removed
- verbosebool, 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:
- jobfilterJobFilter, optional, default None
job filter
- verbosebool, 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_namestr, required
table to be set
- ra_column_namestr, required
ra column to be set
- dec_column_namestr, required
dec column to be set
- verbosebool, optional, default ‘False’
flag to display information about the process
Adds user to a group
- Parameters:
- group_namestr, required
group which user_id will be added in
- user_idstr, required
user id to be added
- verbosebool, optional, default ‘False’
flag to display information about the process
Creates a group
- Parameters:
- group_namestr, required
group to be created
- descriptionstr, required
description of the group
- verbosebool, optional, default ‘False’
flag to display information about the process
Deletes a group
- Parameters:
- group_namestr, required
group to be created
- verbosebool, optional, default ‘False’
flag to display information about the process
Deletes user from a group
- Parameters:
- group_namestr, required
group which user_id will be removed from
- user_idstr, required
user id to be deleted
- verbosebool, optional, default ‘False’
flag to display information about the process
Shares a table with a group
- Parameters:
- group_namestr, required
group in which table will be shared
- table_namestr, required
table to be shared
- descriptionstr, required
description of the sharing
- verbosebool, optional, default ‘False’
flag to display information about the process
Stop sharing a table
- Parameters:
- group_namestr, required
group where the table is shared to
- table_namestr, required
table to be stopped from being shared
- verbosebool, 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_namestr, required
table to be updated
- list_of_changeslist, 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
- verbosebool, 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_resourceobject, mandatory
table to be uploaded: pyTable, file or URL.
- table_namestr, required if uploadResource is provided, default None
resource temporary table name associated to the uploaded resource
- table_descriptionstr, optional, default None
table description
- formatstr, optional, default ‘VOTable’
resource format
- verbosebool, 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_namestr, default ‘t’+jobid
resource temporary table name associated to the uploaded resource
- table_descriptionstr, optional, default None
table description
- verbosebool, optional, default ‘False’
flag to display information about the process