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.0.tar.gz
(13.1 kB
view details)
File details
Details for the file blissclient-0.2.0.tar.gz
.
File metadata
- Download URL: blissclient-0.2.0.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ec93bdfe08b829d29b8cec6dad60083e70b291cd231573bc063b8133d33c578 |
|
MD5 | d98c9fa85a1869e23a3a6af7df6adcbf |
|
BLAKE2b-256 | b8f4e3feeb5f254aae727c7a012b810d9de6730e7b8b2695a7d33b3f1278e307 |