(pyvo2) jrobinson@cuillin:~/rsp_pyvo_test$ conda list # packages in environment at /home/jrobinson/.conda/envs/pyvo2: # # Name Version Build Channel _libgcc_mutex 0.1 main _openmp_mutex 5.1 1_gnu astropy 6.0.1 pypi_0 pypi astropy-iers-data 0.2024.5.27.0.30.8 pypi_0 pypi ca-certificates 2024.3.11 h06a4308_0 certifi 2024.2.2 pypi_0 pypi charset-normalizer 3.3.2 pypi_0 pypi idna 3.7 pypi_0 pypi ld_impl_linux-64 2.38 h1181459_1 libffi 3.4.4 h6a678d5_1 libgcc-ng 11.2.0 h1234567_1 libgomp 11.2.0 h1234567_1 libstdcxx-ng 11.2.0 h1234567_1 ncurses 6.4 h6a678d5_0 numpy 1.26.4 pypi_0 pypi openssl 3.0.13 h7f8727e_2 packaging 24.0 pypi_0 pypi pip 24.0 py39h06a4308_0 pyerfa 2.0.1.4 pypi_0 pypi python 3.9.19 h955ad1f_1 pyvo 1.5.2 pypi_0 pypi pyyaml 6.0.1 pypi_0 pypi readline 8.2 h5eee18b_0 requests 2.32.3 pypi_0 pypi setuptools 69.5.1 py39h06a4308_0 sqlite 3.45.3 h5eee18b_0 tk 8.6.14 h39e8969_0 tzdata 2024a h04d1e81_0 urllib3 2.2.1 pypi_0 pypi wheel 0.43.0 py39h06a4308_0 xz 5.4.6 h5eee18b_1 zlib 1.2.13 h5eee18b_1 (pyvo2) jrobinson@cuillin:~/rsp_pyvo_test$ cat rsp_stelios.py import requests import pyvo #service_name = "data-dev" #tap_url = "https://data-dev.lsst.cloud/api/ssotap" tap_url = "https://data.lsst.cloud/api/ssotap" #token = 'token_here' token = 'XXX' # Setup authorization s = requests.Session() s.headers["Authorization"] = "Bearer " + token auth = pyvo.auth.authsession.AuthSession() auth.credentials.set("lsst-token", s) auth.add_security_method_for_url(tap_url, "lsst-token") auth.add_security_method_for_url(tap_url + "/sync", "lsst-token") auth.add_security_method_for_url(tap_url + "/async", "lsst-token") auth.add_security_method_for_url(tap_url + "/tables", "lsst-token") # Query tap_service = pyvo.dal.TAPService(tap_url, session=auth) jobres = tap_service.run_async("SELECT TOP 10 * FROM TAP_SCHEMA.schemas") print(jobres) s.close() (pyvo2) jrobinson@cuillin:~/rsp_pyvo_test$ python rsp_stelios.py description ... str512 ... --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ... Data Preview 0.3 (ten-year version): Contains the catalog products of a Solar System Science Collaboration simulation of the results of SSO analysis of the wide-fast-deep data from the full LSST ten-year dataset. ... Data Preview 0.3 (one-year version): Contains the catalog products of a Solar System Science Collaboration simulation of the results of SSO analysis of the wide-fast-deep data, based on analyzing only the first year of LSST observations. ... A TAP-standard-mandated schema to describe tablesets in a TAP 1.1 service ... UWS Metadata ... (pyvo2) jrobinson@cuillin:~/rsp_pyvo_test$ cat rsp_stelios2.py import pyvo import os # RSP_TAP_SERVICE = 'https://data-dev.lsst.cloud/api/tap' RSP_TAP_SERVICE = 'https://data.lsst.cloud/api/tap' homedir = os.path.expanduser('~') token_file = os.path.join(homedir,'.rsp-tap.token') with open(token_file, 'r') as f: token_str = f.readline() # token_str = "test" token = 'XXX' cred = pyvo.auth.CredentialStore() cred.set_password("x-oauth-basic", token_str) credential = cred.get("ivo://ivoa.net/sso#BasicAA") rsp_tap = pyvo.dal.TAPService(RSP_TAP_SERVICE, credential) print(rsp_tap.tables) (pyvo2) jrobinson@cuillin:~/rsp_pyvo_test$ python rsp_stelios2.py (pyvo2) jrobinson@cuillin:~/rsp_pyvo_test$ cat rsp_stelios3.py import pyvo import os # RSP_TAP_SERVICE = 'https://data-dev.lsst.cloud/api/tap' RSP_TAP_SERVICE = 'https://data.lsst.cloud/api/tap' homedir = os.path.expanduser('~') token_file = os.path.join(homedir,'.rsp-tap.token') with open(token_file, 'r') as f: token_str = f.readline() cred = pyvo.auth.CredentialStore() cred.set_password("x-oauth-basic", token_str) credential = cred.get("ivo://ivoa.net/sso#BasicAA") print(credential.auth) print(credential.headers) (pyvo2) jrobinson@cuillin:~/rsp_pyvo_test$ python rsp_stelios3.py ('x-oauth-basic', 'XXX\n') {'User-Agent': 'pyVO/1.5.2 Python/3.9.19 (Linux)', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} (pyvo2) jrobinson@cuillin:~/rsp_pyvo_test$