This library provides the python API for a Doctor X Lissajoux device.
Installation
Install the lastest python3 version.
Open command line interface (cmd) and type pip3 install --upgrade drx-lissajoux
Usage examples
The examples below can be run by first saving the example code as a example.py file using for instance Notepad.
Place the license xml file which was provided by Doctor X during delivery of the Lissajoux in the same location as where you saved example.py.
Please adjust the HOST constant in each of the example scripts to the IP adress of your Lissajoux.
Please adjust the KEY_FILE constant in each of the example scripts to the location of your license file.
Note that the license file name is diffrent for each device since it contains the organization and serial number, for example key_TFS_L15.4-7021151.xml
The example can now be run using python3 example.py from the command line.
The path of the command line needs to be set cd "path/to/the/example/folder" to the folder of the example.py file.
Normal operation of the API
The example below demonstrates the normal use of this API library.
import logging
from drx_lissajoux.api import Lissajoux, cmd
# Set the debug level, normal operation: "INFO"
logging.basicConfig(level="DEBUG")
HOST = "192.168.1.100"
KEY_FILE = "./key_file.xml"
# constuct the API object
api = Lissajoux(host=HOST, key_file=KEY_FILE)
# retrieve all properties from the lissajoux and store in the cache, call this each time the properties need to be updated
api.get_state()
# Get some values from the cache and print them
print(f"Global interlock: {api.global_interlock}")
print(f"F1 power: {api.F1_power}")
print(f"Frequency: {api.F1_frequency}")
print(f"Cavity temperature: {api.Cavity_temperature}")
print(f"PSU 5V: {api.PSU_5_volt}")
# Set the frequency of the lissajoux to a new value
api.F1_frequency = 2418.0
# Close the connection
api.close()
Available properties
The example below will print all available properties of the Lissajoux that can be used with this library.
from drx_lissajoux.api import Lissajoux
HOST = "192.168.1.100"
KEY_FILE = "./key_file.xml"
api = Lissajoux(host=HOST, key_file=KEY_FILE)
print("\nAvailable properties:")
for prop in api.available_properties:
print(prop)
Sending custom commands to the Lissajoux
The example below demonstrates how to send custom commands to the Lissajoux. A full list of the available commands for the Lissajoux can be found in the API section in the manual supplied with the device.
from drx_lissajoux.api import Lissajoux, cmd
HOST = "192.168.1.100"
KEY_FILE = "./key_file.xml"
# constuct the API object
api = Lissajoux(host=HOST, key_file=KEY_FILE)
# send a single command to GET the frequency
cmd_freq = api.send_command(cmd("Frq"))
print(f"Frequency: {cmd_freq.value}")
# send a single command to SET the frequency
cmd_freq = api.send_command(cmd("Frq", "=", 2417.0))
print(f"Frequency: {cmd_freq.value}")
# send 5 commands in one message to GET all PSU voltages
response = api.send_command([cmd("V05"), cmd("V55"), cmd("V15"), cmd("Vm5"), cmd("V24")])
for val in response.values():
print(f"{val.cmd}: {val.value}")
# Close the connection
api.close()
Metadata
Release files for drx-lissajoux 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| drx_lissajoux-2.0.1.tar.gz | 5.6 kB | Without provenance | Details for drx_lissajoux-2.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| drx_lissajoux-2.0.1-py3-none-any.whl | Python 3 | none | any | Details for drx_lissajoux-2.0.1-py3-none-any.whl |
Total release size: 11.4 kB
Release files / drx_lissajoux-2.0.1.tar.gz
| Download URL | drx_lissajoux-2.0.1.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb48160b828bb3608d24a7da3bc54f0b3002b02920c62e72462ee21afeee9b3b
|
|
BLAKE2b-256 checksum How to use checksums |
33cc4e6954b75331c4812ea3502d13c06ac0430caa2268af44685f04de74d166
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / drx_lissajoux-2.0.1-py3-none-any.whl
| Download URL | drx_lissajoux-2.0.1-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
02806a97bb1d8e22369fbc78ef38c49407907cf9f0255863fc558a5ccf3d6abf
|
|
BLAKE2b-256 checksum How to use checksums |
8323043661e83002c02abd249a30c24b697201bba03a1e69bf618b66ec1e464e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Security for drx-lissajoux 2.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.