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

Uploaded Source

File details

Details for the file blissclient-0.1.0.tar.gz.

File metadata

  • Download URL: blissclient-0.1.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for blissclient-0.1.0.tar.gz
Algorithm Hash digest
SHA256 723e522c44746bdce4084c2aaba6447eca34ef01e3314e6261f6722a48cba3ac
MD5 2ab4f75b63fbc6c7b47217dc2f009c51
BLAKE2b-256 f09e958771e61aab88c2d03eb9fd3387d7a3f25ff61761238fd3c3f88f514491

See more details on using hashes here.

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