Metadata-Version: 2.4
Name: tom-hermes
Version: 0.2.1
Summary: A TOM Toolkit Broker module for querying the Hermes Alert API
License: GPL-3.0-or-later
License-File: LICENSE
Author: Lindy Lindstrom
Author-email: llindstrom@lco.global
Requires-Python: >=3.10.0,<3.14
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: tomtoolkit (>=3.0.0)
Description-Content-Type: text/markdown

[![pypi](https://img.shields.io/pypi/v/tom-hermes.svg)](https://pypi.python.org/pypi/tom-hermes)

# tom_hermes
This module adds the [Hermes](https://hermes.lco.global) dataservice to the TOM Toolkit. 
Using this module, TOMs can query targets in the Hermes alert archive.

## Installation

Install the module into your TOM environment:

    pip install tom-hermes


Add `tom_hermes` to your `settings.INSTALLED_APPS`:

```python
    INSTALLED_APPS = TOMTOOKIT_INSTALLED_APPS + [
    'custom_code',
    ...
    'tom_hermes',

    ]
```

## Configuration

Configure your app with TOM-wide credentials by adding the following to your `settings.py` and setting your
`HERMES_API_TOKEN` in your environment:

```python
    HERMES_CONFIGURATION = {
        'HERMES_API_TOKEN': os.getenv('HERMES_API_TOKEN', None),  # Defaults here if user API token not set
        'HERMES_BASE_URL': 'https://hermes-dev.lco.global/', # Optional: Defaults to `https://hermes.lco.global/`
        'DEFAULT_TOPIC': 'myfavorite.topic',  # Optional: Defaults to 'tomtoolkit.test'
    }
```

You can add `HERMES_BASE_URL` to your `settings.py` if you want to point to a HERMES instance other than `https://hermes.lco.global` for submission testing. Retrieving targets from the HERMES Data Service will continue to use https://hermes.lco.global/.
and `DEFAULT_TOPIC` if you want messages to default to a topic other than `'tomtoolkit.test'`.

Users can also add their personal credentials via their profile. If you wish to rely on the defaults above and/or user credentials, then a `settings.HERMES_CONFIGURATION` configuration dictionary is not required.

`Hermes` is now available as a Data Service from the "Data Services" nav-bar menu. You may configure and execute your queries as you would any Data Service.

