Skip to main content

TOM Toolkit Facility module for the Neil Gehrels Swift Observatory

Project description

tom_swift

Neil Gehrels Swift Observatory facility module for TOM Toolkit. This module uses the Swift TOO API for all its interactions with the Swift Observatory. When installed and configured, your TOM can query target visibility, submit TOO observation requests to Swift, and check TOO observation status.

Swift TOO Prerequisites

In order to submit TOO requests to Swift, you must register with the Swift TOO system. Once you are registered and have logged in, you can get your shared secret, which you will use, along with your username, to make TOO requests. See the Configuration section below.

Installation

Install the module into your TOM environment:

pip install tom-swift
  1. In your project settings.py, add tom_swift to your INSTALLED_APPS setting:

    INSTALLED_APPS = [
        ...
        'tom_swift',
    ]
    
  2. Add tom_swift.swift.SwiftFacility to the TOM_FACILITY_CLASSES in your TOM's settings.py:

     TOM_FACILITY_CLASSES = [
         'tom_observations.facilities.lco.LCOFacility',
         ...
         'tom_swift.swift.SwiftFacility',
     ]
    

Configuration

Include the following settings inside the FACILITIES dictionary inside settings.py:

    FACILITIES = {
        ...
        'SWIFT': {
            'SWIFT_USERNAME': os.getenv('SWIFT_USERNAME', 'anonymous'),
            'SWIFT_SHARED_SECRET': os.getenv('SWIFT_SHARED_SECRET', 'anonymous'),
        },
    }

If you followed the Prerequsites section above, then you have a Swift TOO username and shared secret. (Your shared secret is not your Swift TOO account password). Set environment variables SWIFT_USERNAME and SWIFT_SHARED_SECRET to your Swift TOO username and shared secret, respectively. (Do not check them into any software repository).

export SWIFT_USERNAME='<your Swift TOO usename>'
export SWIFT_SHARED_SECRET='<your Swift TOO shared secret>'

The settings.FACILITIES['Swift'] configuration dictionary above will get the values from the environment variables that you set. Your TOM will then use them to interact with the Swift TOO API.

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

tom_swift-0.3.0.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

tom_swift-0.3.0-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

Details for the file tom_swift-0.3.0.tar.gz.

File metadata

  • Download URL: tom_swift-0.3.0.tar.gz
  • Upload date:
  • Size: 27.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.10

File hashes

Hashes for tom_swift-0.3.0.tar.gz
Algorithm Hash digest
SHA256 235dd7fd0cfab9fe7f8991b15a7881d22664518e0f7d7b70517735205ea342e8
MD5 2a535857233873a884af2f95ee0e5f7f
BLAKE2b-256 e3321f19ec4231d98c40c7618d401b9f4ea251d730e8c924d046b18a871293b3

See more details on using hashes here.

File details

Details for the file tom_swift-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: tom_swift-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 28.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.10

File hashes

Hashes for tom_swift-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 26db42f8af7853154dc8f7d129d0d22cb6530a62a6e4aa3ea305d2981e0a6ba7
MD5 5375728a5f0a59c152b21dade89d9785
BLAKE2b-256 f5af52e835d1aac6a995dde12f0c05a1223e957ba0e6c5642442c18122c81b2a

See more details on using hashes here.

Supported by

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