An open API service indexing awesome lists of open source software.

https://github.com/tiwater/rerun-query

Query and extract entity data from Rerun data files.
https://github.com/tiwater/rerun-query

apache-arrow pyo3 rerun

Last synced: 10 months ago
JSON representation

Query and extract entity data from Rerun data files.

Awesome Lists containing this project

README

          

# Rerun Query

[![PyPI version](https://img.shields.io/pypi/v/rerun-query.svg?color=green)](https://pypi.org/project/rerun-query/)
[![Downloads](https://static.pepy.tech/badge/rerun-query)](https://pepy.tech/project/rerun-query)
[![License](https://img.shields.io/github/license/tiwater/rerun-query.svg)](https://github.com/tiwater/rerun-query/blob/main/LICENSE)
[![Supported Python Version](https://img.shields.io/pypi/pyversions/rerun-query.svg)](https://pypi.org/project/rerun-query)

Python SDK to query and extract data from [Rerun](https://rerun.io) files.

## Rerun Compatibility

This project is only compatible with Rerun 0.18. Please make sure the source rrd file is created with this version of Rerun SDK [[Rust](https://docs.rs/rerun/latest/rerun/)].

> [!NOTE]
> The Blueprint of Rerun data (controls the layout of the viewer) is ignored for now, while the entity_paths were still included in the return value of `list_entity_paths()`.
>
> Please [open an issue](https://github.com/tiwater/rerun-query/issues/new) if you need this feature or other help.

## Install

This project depends on `numpy`, so please make sure install it with this package together.

```bash
pip install numpy rerun-query
```

The retrieved data is in numpy arrays.

## Usage

Use this package:

```py
import requery

data = requery.query_data_entities(file_path, "", "")
for data_row in data:
print(f"Entity Path: {data_row.entity_path}")
for timeline_key, times in data_row.timelines.items():
print(f"Timeline({timeline_key}) - {times}")
data_object = data_row.data
for index, data in enumerate(data_object[:10]):
print(f"- {index + 1} {data}")
```

## Example

You can find running example and sample data file in [examples](https://github.com/tiwater/rerun-query/tree/main/examples) folder.

To run the example Python code:

```bash
cd ./examples
python3 -m venv .venv
source .venv/bin/activate
python3 main.py
```

The output includes entity paths, meta data, and tensor data in numpy arrays.

To view the logs in detail, run the program as:

```bash
RUST_LOG=debug python3 main.py
```

If the program crashes unexpectedly, try to diagnose with:

```bash
RUST_BACKTRACE=1 python3 main.py
```