Skip to main content

Client for accessing data at the Canadian Astronomy Data Centre

Project description

This package implements a client for access the CADC data Web service (WS)

The package can be used as a library as well as through the cadc-data
command it installs.

1. Instantiate CadcDataClient and use it to access the data WS.

The only mandatory argument that the CadcDataClient constructor takes is
a cadcutils.net.Subject that holds the user credentials. The data WS is
accessed through the get_file, put_file and get_file_info functions of the client.

Example:
from cadcdata import CadcDataClient
from cadcutils import net

client = CadcDataClient(net.Subject())
print(client.get_file_info('GEMINI', '00AUG02_002'))

2. Invoke the cadc-data entry point function. This is the function that
is used to generate the cadc-data application

Example:
from cadcdata import main_app
import sys

sys.argv = ['cadc-data', 'info', '-a', 'GEMINI', '00AUG02_002']
main_app()

3. Invoke the cadc-data as an external command
Example:
import os
os.system('cadc-data info -a GEMINI 00AUG02_002')

Method 1. is the recommended method as it does not required forking external processes
and also allows trapping the exceptions and reacting according to the type of the
error. Method 2 also works but the sys.exit needs to be trapped in order
to prevent the script from quiting. Method 3, while simple, must rely on inter
processes communication to determine the result of running the command.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cadcdata-1.1a2.tar.gz (51.0 kB view details)

Uploaded Source

File details

Details for the file cadcdata-1.1a2.tar.gz.

File metadata

  • Download URL: cadcdata-1.1a2.tar.gz
  • Upload date:
  • Size: 51.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cadcdata-1.1a2.tar.gz
Algorithm Hash digest
SHA256 2ac47e7ba9d84954be4df7b00eda5bd058a509f497c91c13a2f743b3114e0a06
MD5 30018c1a99770b09ebcf2bf005842c69
BLAKE2b-256 b44b00fbda0c05485049fffe88d840dec1a0bea8f8c3c169a303bd71b911ffe3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page