/  Python Yamcs Client  /  General Client

General Client

Reference

Snippets

Create a YamcsClient:

from yamcs.client import YamcsClient

client = YamcsClient('localhost:8090')

Provide credentials if Yamcs is secured:

from yamcs.client import Credentials, YamcsClient

credentials = Credentials(username='admin', password='password')
client = YamcsClient('localhost:8090', credentials=credentials)

Events

Receive Event callbacks:


def callback(event):
    print("Event:", event)

client.create_event_subscription(instance="simulator", on_data=callback)

sleep(5)  # Subscription is non-blocking

Send an event:

client.send_event(instance="simulator", message="hello world")