Skip to main content

The Rerun Logging SDK

Project description

The Rerun Python Log SDK

Rerun is an SDK for logging computer vision and robotics data paired with a visualizer for exploring that data over time. It lets you debug and understand the internal state and data of your systems with minimal code.

Rerun Viewer

Install

pip3 install rerun-sdk

ℹ️ Note: The Python module is called rerun, while the package published on PyPI is rerun-sdk.

Example

import rerun as rr
import numpy as np

rr.spawn()

positions = np.vstack([xyz.ravel() for xyz in np.mgrid[3 * [slice(-5, 5, 10j)]]]).T
colors = np.vstack([rgb.ravel() for rgb in np.mgrid[3 * [slice(0, 255, 10j)]]]).astype(np.uint8).T

rr.log_points("my_points", positions=positions, colors=colors)

Resources

Logging and viewing in different processes

You can run the viewer and logger in different processes.

In one terminal, start up a viewer with a server that the SDK can connect to:

python3 -m rerun

In a second terminal, run the example with the --connect option:

python3 examples/python/car/main.py --connect

From Source

Setup:

  • Install the Rust toolchain: https://rustup.rs/
  • git clone git@github.com:rerun-io/rerun.git && cd rerun
  • Run ./scripts/setup_dev.sh.
  • Make sure cargo --version prints 1.67.1 once you are done

Building

To build from source and install Rerun into your current Python environment run:

python3 -m pip install --upgrade pip
pip3 install -r rerun_py/requirements-build.txt
pip3 install "./rerun_py"

ℹ️ Note: If you are unable to upgrade pip to version >=21.3, you need to pass --use-feature=in-tree-build to the pip3 install command.

Development

To set up a new virtualenv for development:

just py-dev-env
# For bash/zsh users:
source venv/bin/activate
# Or if you're using fish:
source venv/bin/activate.fish

Build, test, and run

For ease of development you can build and install in "editable" mode. This means you can edit the rerun Python code without having to re-build and install to see changes.

# Build the SDK and install in develop mode into the virtualenv
# Re-run this if the Rust code has changed!
just py-build

Test

# Run the unit tests
just py-test

# Run the linting checks
just py-lint

# Run an example
python examples/python/car/main.py

Building an installable Python Wheel

The Python bindings to the core Rust library are built using https://github.com/PyO3/pyo3.

To build an installable Python wheel run:

pip install -r rerun_py/requirements-build.txt
maturin build -m rerun_py/Cargo.toml --release

By default the wheels will be built to target/wheels (use the -o flag to set a different output directory).

Now you can install rerun in any Python3 environment using:

pip3 install target/wheels/*.whl

Viewing the docs locally

The rerun python docs are generated using mkdocs

Install the doc requirements:

pip install -r rerun_py/requirements-doc.txt

Serve the docs:

mkdocs serve -f rerun_py/mkdocs.yml -w rerun_py

or

just py-docs-serve

For information on how the docs system works, see: docs/docs.md

Troubleshooting

You can run with RUST_LOG=debug to get more output out of the rerun SDK.

If you are using an Apple-silicon Mac, make sure rustc -vV outputs host: aarch64-apple-darwin. If not, this should fix it:

rustup set default-host aarch64-apple-darwin && rustup install 1.67

If you want to switch back, this is how:

rustup set default-host x86_64-apple-darwin && rustup install 1.67

Project details


Release history Release notifications | RSS feed

This version

0.5.1

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

rerun_sdk-0.5.1-cp38-abi3-win_amd64.whl (19.7 MB view details)

Uploaded CPython 3.8+Windows x86-64

rerun_sdk-0.5.1-cp38-abi3-manylinux_2_31_x86_64.whl (25.1 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.31+ x86-64

rerun_sdk-0.5.1-cp38-abi3-macosx_11_0_arm64.whl (20.4 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

rerun_sdk-0.5.1-cp38-abi3-macosx_10_7_x86_64.whl (21.4 MB view details)

Uploaded CPython 3.8+macOS 10.7+ x86-64

File details

Details for the file rerun_sdk-0.5.1-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: rerun_sdk-0.5.1-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 19.7 MB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.14.17

File hashes

Hashes for rerun_sdk-0.5.1-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e96f89f0abad8f1fa70ffe4c3b5ea21ca0c29e272eec7d1db961bbf34dbc4f9c
MD5 fa7d94e8692207cd86fccfd6d40c6403
BLAKE2b-256 b20d15f3824a283ee11ba61137201abf79099cad278cd95a02aa8b0506b176fb

See more details on using hashes here.

File details

Details for the file rerun_sdk-0.5.1-cp38-abi3-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for rerun_sdk-0.5.1-cp38-abi3-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 2d3dc9e54895f37ca51460b17f0b6a4bdbd8e0caa7297758f79f077ef041b041
MD5 1faedb0541ff6c625a9b2b94728fb2e1
BLAKE2b-256 28f3a58a95f83910693d8f175ba79988530032604eaec0cafa42870692e50d86

See more details on using hashes here.

File details

Details for the file rerun_sdk-0.5.1-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rerun_sdk-0.5.1-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9ae1041a679310f1a0e86fc01bc363b1882a4add2688535e8996cbabb0e2b4e5
MD5 709cd208d3ea065939e804c075f97e66
BLAKE2b-256 374440f67ffa78afdcd22198e79b26ab9d6c59fce8235ee7437eb8c21b8abfdb

See more details on using hashes here.

File details

Details for the file rerun_sdk-0.5.1-cp38-abi3-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for rerun_sdk-0.5.1-cp38-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 2aebd3ffdedf0e1e082f3d667ae6b454ffc21ea4fd9d1da53cc9f10120fa56da
MD5 799b036ee2110a69ed5617ce0984b820
BLAKE2b-256 1a2ca5ae0804f9af47d062b76afa5f357fabfb20796d15b26a340455ad0abb28

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page