Skip to main content

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybrotlib-1.2.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybrotlib-1.2.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file pybrotlib-1.2.0.tar.gz.

File metadata

  • Download URL: pybrotlib-1.2.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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}

File hashes

Hashes for pybrotlib-1.2.0.tar.gz
Algorithm Hash digest
SHA256 f22ca4288c29704d6e74f00aa691aa16f96dc3e5c6b2460e4e2b60d81e942b88
MD5 9ee97698a414d8e41c76696a349c3473
BLAKE2b-256 80aa1756caeb6e4f2b1ea5c2d34a8f90942d5af6759db4709acadb172835b463

See more details on using hashes here.

File details

Details for the file pybrotlib-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: pybrotlib-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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}

File hashes

Hashes for pybrotlib-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ccbe25a8e2fcb70364f8e26ac9af8cd75cc819051232d093b0d0932afb57958
MD5 2d937e1bdb20e84cf3bca85401fe2080
BLAKE2b-256 d55200e6c561ceb25f8025bfb741ff25f7080d61a9098850c4d423e518d4380d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 files

1.1.8

2 files

1.1.7

2 files

1.1.6

2 files

1.1.5

2 files

1.1.4

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

2 files

0.3.11

2 files

0.3.10

2 files

0.3.9

2 files

0.3.8

2 files

0.3.7

2 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page