pyBROTlib
Python interface to BROT telescopes, talking to the telescope's TwinCAT/PLC control system over MQTT.
Installation
uv add pybrotlib
Usage
Connect a transport (currently MQTT) to a named telescope and drive it through the BROT
object:
import asyncio
from pybrotlib import BROT
from pybrotlib.transport import MQTTTransport
async def main() -> None:
transport = MQTTTransport(host="localhost", port=1883)
brot = BROT(transport, "MyTelescope")
# the transport needs its own task to receive telemetry/publish commands
asyncio.create_task(transport.run())
await asyncio.sleep(2) # give it a moment to connect and receive first telemetry
await brot.telescope.track(ra=10.5, dec=41.2)
print(brot.telescope.status)
asyncio.run(main())
transport.telemetry holds the live telemetry tree (see pybrotlib/telemetry.py), which is
kept up to date by messages received on <telescope>/.../Telemetry topics and read by the
component properties below.
Components
Each BROT instance exposes one component per subsystem, all constructed from the same
transport and telescope name:
telescope(BROTTelescope) — pointing (track,move), offsets (set_offset_ha,set_offset_dec,set_offset_alt,set_offset_az), power/park/stop/reset, and status (status,motion_state,global_status).focus(BROTFocus) —position,set(focus),powered,referenced.dome(BROTDome) — shutter/tracking state,open,close,start_tracking,stop_tracking,park,reset.roof(BROTRoof) — roll-off roof state,open,close,stop,reset.mirrorcovers(BROTMirrorCovers) —status,open,close.
All commands are fire-and-forget MQTT publishes; callers are expected to poll telemetry (directly, or via the component's status properties) to observe the result.
Development
uv sync --group dev
uv run pytest
Metadata
Release files for pyBROTlib 1.2.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 | |
|---|---|---|---|
| pybrotlib-1.2.1.tar.gz | 6.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pybrotlib-1.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.8 kB
Release files / pybrotlib-1.2.1.tar.gz
| Download URL | pybrotlib-1.2.1.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
83e14a8b375c086f42c95d3bd8a327bc61c40844b134f6a485403b380c2e6108
|
|
BLAKE2b-256 checksum How to use checksums |
0b869dd09efee500379509948182adc85d4537ab2efeabfe0e780a01428452ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / pybrotlib-1.2.1-py3-none-any.whl
| Download URL | pybrotlib-1.2.1-py3-none-any.whl |
|---|---|
| Size | 11.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e0b5c5dd0e0b1c56e234e22c44bc1afd55cd4b237734acc53883c94785393c46
|
|
BLAKE2b-256 checksum How to use checksums |
7349d6660ad6d02e0f96d236d67dd27a2e16fa99e2cf67bb725517ec6ede0996
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|