Skip to main content

Client for Bliss API

Project description

blissclient

A python client for blissterm, the high-level client is fully typed ready for auto-completion in any modern IDE.

Getting Started

Set the BLISSTERM_URL

export BLISSTERM_URL=http://localhost:5000

Then:

from blissclient import BlissClient

client = BlissClient()

omega = client.hardware.get("omega")
print(omega.position)

omega.move(100)
omega.wait()

Execute calls in the session:

from blissclient import BlissClient


client = BlissClient()
test_session = client.session("test_session")

# Blocking until the call terminates
return_value =test_session.call("ascan", "$omega", 0, 10, 10, 0.1, "$diode")

Strings prefixed with $ are translated to the relevant beacon objects

Or execute asynchronously:

import time
from blissclient import BlissClient

client = BlissClient()

test_session = client.session("test_session")
call_id = test_session.call("ascan", "$omega", 0, 10, 10, 0.1, "$diode", call_async=True)

while True:
    response = test_session.state(call_id=call_id)
    if response.state == "terminated":
        break
    else:
        time.sleep(1)

    print(response.return_value)

    # The redis scan key, can be used with `blissdata``
    response.return_value["key"]

See the test suite for more examples.

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

blissclient-0.2.1.tar.gz (13.1 kB view hashes)

Uploaded Source

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