Metadata-Version: 2.2
Name: vista-gateway-client
Version: 0.1.1
Summary: Configured client for ISO 19848 protocols and package types.
Author: DNV AS
Author-email: software.support@dnv.com
License: MIT
Keywords: vista,iso19848
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: python-jsonschema-objects>=0.5.5
Requires-Dist: jsonschema>=4.22.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: keywords
Dynamic: license
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Vista Gateway Client

Vista Gateway Client is a library that provides a configured client for supported protocols and package types.
It ensures strict implementation and validation of the packages according to their respective supported types.

## Supported Protocols

- **HTTPS**
- **MQTT**

## Supported Package Types
- **ISO19848 DataChannelList**
- **ISO19848 TimeSeriesData**

### What is ISO19848?

ISO 19848 is an international standard for the digital exchange of data between ship systems, covering both operational and technical data.
It standardizes the structure of data for easier exchange and interpretation, facilitating data integration in maritime industries.

- **Schemas:** [ISO19848 schemas](https://github.com/dnv-opensource/vista-sdk/tree/main/schemas/json)
- **Vista documentation:** [docs.vista.dnv.com](docs.vista.dnv.com)


## Acquire an API Key

To use Vista Gateway Client, you will need an API key to authenticate with the gateway.
Please reach out to your DNV contact to request an API key.
When doing so, make sure to mention the specific service you are interested in to ensure you receive the correct key for your use case.

## Installation

To use the Vista Gateway Client, you need **Python >=3.8**. Follow the steps below to install and configure the client.

### 1. Install Package

Install the package using pip:

```sh
pip install vista-gateway-client
```

### 2. Initialize Client

```python
from vista_gateway_client.client import Client

client = Client(
    api_key = "<Your API Key>",
    protocol = "Http",  # or "Mqtt"
)
```

### 3. Create and Send a Package

```python
from vista_gateway_client.gateway_package import ISO19848, DataChannel, TimeSeries
from vista_gateway_client.vista_gateway_exception import VistaGatewayException

# Create package. E.g. ISO19848 DataChannelList
package = DataChannel.Package(
    # Configure the package according to ISO 19848 standard
)

# Create client package
client_package = ISO19848.DataChannelList(
    package=package,
    external_id="<Your External ID>",
    correlation_id="<Your Correlation ID>",
    user_agent="<Your User Agent>"
)

try:
    # Send the package
    client.send(client_package)
except VistaGatewayException as e:
    # Handle VistaGatewayException
```
