Skip to main content

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.

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.4.1.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tom_swift-0.4.1-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tom_swift-0.4.1.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for tom_swift-0.4.1.tar.gz
Algorithm Hash digest
SHA256 9b35e1320c23ebeecc89528eb2e773a920a94d66e250dde3f48c3849b1b10115
MD5 0caae3dbf8bf397a98287386ed8aa2a2
BLAKE2b-256 0eadb0ec58972451286da57a484c4ce2ad205da96c91949acae5f6d116718617

See more details on using hashes here.

Provenance

The following attestation bundles were made for tom_swift-0.4.1.tar.gz:

Publisher: pypi-release.yml on TOMToolkit/tom_swift

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: tom_swift-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 28.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for tom_swift-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 43a7e65c668f506b42376c589f7f4abe11c618630eaa5d84e2f524f7817012ef
MD5 d4463b8d5308d60be4ca5831f23dacca
BLAKE2b-256 5bffda3ee8876fbbc591218e653b5f223815001c0623da275a1030a017af56c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for tom_swift-0.4.1-py3-none-any.whl:

Publisher: pypi-release.yml on TOMToolkit/tom_swift

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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