Metadata-Version: 2.4
Name: donglora
Version: 1.0.0
Summary: DongLoRa host library — talk LoRa from Python over USB
Project-URL: Repository, https://github.com/donglora/client-py
Project-URL: Homepage, https://github.com/donglora/client-py
Author-email: Stephen Waits <steve@waits.net>
License-Expression: MIT
Keywords: embedded,lora,radio,serial,usb
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Communications :: Ham Radio
Classifier: Topic :: System :: Hardware
Requires-Python: >=3.10
Requires-Dist: cobs
Requires-Dist: pyserial
Provides-Extra: meshcore
Requires-Dist: pycryptodome; extra == 'meshcore'
Requires-Dist: pynacl; extra == 'meshcore'
Provides-Extra: orac
Requires-Dist: anthropic; extra == 'orac'
Requires-Dist: pycryptodome; extra == 'orac'
Requires-Dist: pynacl; extra == 'orac'
Description-Content-Type: text/markdown

# DongLoRa Python Client

Python client library for talking to a DongLoRa device — either directly
over USB or through the [mux daemon](https://github.com/donglora/mux-py).

## Install

```
pip install donglora
```

Or with [uv](https://docs.astral.sh/uv/):

```
uv add donglora
```

## Quick Start

```python
import donglora as dl

ser = dl.connect()
dl.send(ser, "SetConfig", config=dl.DEFAULT_CONFIG)
dl.send(ser, "StartRx")

while True:
    pkt = dl.recv(ser)
    if pkt:
        print(pkt["rssi"], pkt["payload"].hex())
```

## Connection Functions

| Function | Description |
|----------|-------------|
| `connect()` | Auto-detect: TCP mux, Unix socket mux, then USB serial |
| `connect_default()` | Convenience wrapper with default timeout |
| `try_connect()` | Like `connect()` but non-blocking — raises if no device found |
| `connect_mux_auto()` | Mux only — never falls back to USB serial |
| `mux_connect()` | Connect via Unix domain socket |
| `mux_tcp_connect()` | Connect via TCP |

## Module Structure

| Module | Contents |
|--------|----------|
| `donglora.protocol` | Wire types, RadioConfig, encode/decode, constants |
| `donglora.codec` | COBS framing |
| `donglora.discovery` | USB device discovery by VID:PID |
| `donglora.transport` | MuxConnection (socket wrapper) |
| `donglora.connect` | Connection auto-detection and mux helpers |
| `donglora.client` | High-level send/recv/validate |

Everything is re-exported from the top-level `donglora` package.

## Dependencies

- `cobs` — COBS framing
- `pyserial` — USB serial communication

Optional extras: `meshcore` (crypto), `orac` (AI bot).

## Development

```
just check    # fmt + lint + test
just fmt      # format code
just test     # run tests
```
