Metadata-Version: 2.5
Name: xdof-sdk
Version: 0.1.0rc2
Summary: Read and visualize xdof-delivered data (MCAP topic names, protobuf schemas, a Rerun viewer) and serve policies to xdof evals.
Author-email: Michael Luo <mluogh@xdof.ai>
Requires-Python: >=3.10
Requires-Dist: mcap-protobuf-support<1.0.0,>=0.5.3
Requires-Dist: mcap<2.0.0,>=1.2.2
Requires-Dist: numpy>=1.0.0
Requires-Dist: protobuf>=6.31.1
Provides-Extra: all
Requires-Dist: av>=12.0.0; extra == 'all'
Requires-Dist: grpcio>=1.80; extra == 'all'
Requires-Dist: httpx-sse<0.5,>=0.4; extra == 'all'
Requires-Dist: httpx<1,>=0.28.1; extra == 'all'
Requires-Dist: numpy>=1.24; extra == 'all'
Requires-Dist: protobuf<7,>=6.31.1; extra == 'all'
Requires-Dist: pydantic<3.0.0,>=2.0.0; extra == 'all'
Requires-Dist: rerun-sdk==0.28.1; extra == 'all'
Requires-Dist: scipy>=1.10.0; extra == 'all'
Provides-Extra: eval
Requires-Dist: grpcio>=1.80; extra == 'eval'
Requires-Dist: httpx-sse<0.5,>=0.4; extra == 'eval'
Requires-Dist: httpx<1,>=0.28.1; extra == 'eval'
Requires-Dist: numpy>=1.24; extra == 'eval'
Requires-Dist: protobuf<7,>=6.31.1; extra == 'eval'
Requires-Dist: pydantic<3.0.0,>=2.0.0; extra == 'eval'
Provides-Extra: viz
Requires-Dist: av>=12.0.0; extra == 'viz'
Requires-Dist: rerun-sdk==0.28.1; extra == 'viz'
Requires-Dist: scipy>=1.10.0; extra == 'viz'
Description-Content-Type: text/markdown

# xdof-sdk

Read and visualize data delivered by xdof, and serve policies to xdof evaluations.

## Installation

```bash
pip install xdof-sdk          # MCAP topic names + protobuf schemas
pip install "xdof-sdk[viz]"   # + Rerun viewer
pip install "xdof-sdk[eval]"  # + eval worker SDK
```

`0.0.1rc13` is the last release that includes the `Trajectory` loader (`xdof_sdk.data`).

## Visualization

Open an episode (a directory of MCAPs, or a single `.mcap`) in Rerun:

```bash
xdof-viz /path/to/episode/
xdof-viz /path/to/episode/ --headless --open-browser   # serve the web viewer instead
```

## Reading MCAPs

Delivered MCAPs embed their protobuf schemas, so the `mcap` package decodes them directly. The same
messages are importable from `xdof_sdk.proto`, and standard topic names live in `xdof_sdk.constants`.

```python
from mcap.reader import make_reader
from mcap_protobuf.decoder import DecoderFactory

TOPIC = "/left-arm-state"  # any protobuf channel listed in your delivery's format spec

with open("episode.mcap", "rb") as f:
    reader = make_reader(f, decoder_factories=[DecoderFactory()])
    for _, channel, message, decoded in reader.iter_decoded_messages(topics=[TOPIC]):
        print(message.log_time, decoded)
```

## Eval worker

`xdof_sdk.eval` serves a policy to xdof's model-eval service and registers runtimes and evaluations:

```python
from xdof_sdk.eval import Action, Observation, Policy, run_worker
```

See [docs.xdof.ai](https://docs.xdof.ai) for the worker, runtime, and evaluation APIs.
