Skip to main content

The Rerun Python Log SDK

Use the Rerun SDK to log data like images, tensors, point clouds, and text. Logs are streamed to the Rerun Viewer for live visualization or to file for later use.

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.init("rerun_example_app", spawn=True)

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("points3d", rr.Points3D(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 python examples/python/plots/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.74.0 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!
source venv/bin/activate
just py-build

Test

# Run the unit tests
just py-test

# Run the linting checks
just py-lint

# Run an example
python examples/python/minimal/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/writing_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.74

If you want to switch back, this is how:

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

Release files for rerun-sdk 0.15.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for rerun-sdk 0.15.0
File
rerun_sdk-0.15.0-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details
rerun_sdk-0.15.0-cp38-abi3-manylinux_2_31_x86_64.whl CPython 3.8 abi3 Linux glibc 2.31+ x86-64 Details
rerun_sdk-0.15.0-cp38-abi3-manylinux_2_31_aarch64.whl CPython 3.8 abi3 Linux glibc 2.31+ ARM64 Details
rerun_sdk-0.15.0-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details
rerun_sdk-0.15.0-cp38-abi3-macosx_10_12_x86_64.whl CPython 3.8 abi3 macOS 10.12+ x86-64 Details

Total release size: 115.7 MB

Release files / rerun_sdk-0.15.0-cp38-abi3-win_amd64.whl

Download URL rerun_sdk-0.15.0-cp38-abi3-win_amd64.whl
Size 19.2 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
30e3ae4c5d2502ac5b48bd984334908d2dddbc9d3cd8ac9514388f3cec9abd02
BLAKE2b-256 checksum
How to use checksums
af98abdcedf7fd12e28cc2454b87fc988b9d8031ba052ecec6e2dbcf019b1836
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.5.1

Release files / rerun_sdk-0.15.0-cp38-abi3-manylinux_2_31_x86_64.whl

Download URL rerun_sdk-0.15.0-cp38-abi3-manylinux_2_31_x86_64.whl
Size 27.2 MB
Tags CPython 3.8 Linux glibc 2.31+ x86-64 abi3
SHA-256 checksum
How to use checksums
a344b0720194ec8462893b028677f580e9ee88881e693fdfe3e113ff33412601
BLAKE2b-256 checksum
How to use checksums
b3d7ac0b4cb81ac0c5d7fad3ff36b0ff5ca774e1e561822773359b62c6d7b7ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.5.1

Release files / rerun_sdk-0.15.0-cp38-abi3-manylinux_2_31_aarch64.whl

Download URL rerun_sdk-0.15.0-cp38-abi3-manylinux_2_31_aarch64.whl
Size 26.8 MB
Tags CPython 3.8 Linux glibc 2.31+ ARM64 abi3
SHA-256 checksum
How to use checksums
adfaae3e86e71c12dcdb2015e7706fec83fb24b24c4e15ba8464b4a355c8c304
BLAKE2b-256 checksum
How to use checksums
305ae3d02f0147ad20aa3a34975d4137afac68b2ef4c52efc572a6b1958c25f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.5.1

Release files / rerun_sdk-0.15.0-cp38-abi3-macosx_11_0_arm64.whl

Download URL rerun_sdk-0.15.0-cp38-abi3-macosx_11_0_arm64.whl
Size 20.9 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
fb2e9c13a2ccbb77dc059b2d0b8064c4335a65eae92e54b00aabffeaa5d1ee52
BLAKE2b-256 checksum
How to use checksums
6295b3373600ef590184946825afa65e9aeda0d941c37b9a8ed0711e6c96e7c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.5.1

Release files / rerun_sdk-0.15.0-cp38-abi3-macosx_10_12_x86_64.whl

Download URL rerun_sdk-0.15.0-cp38-abi3-macosx_10_12_x86_64.whl
Size 21.7 MB
Tags CPython 3.8 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
d323842918690b93f7137ad02fa257f843dfa1c6861707d9245f7d4b0c8a000b
BLAKE2b-256 checksum
How to use checksums
c8dd23413facc03895001f2260621ac7d394e317de0be9f130dffcd4ca1191d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.5.1

Release history Release notifications | RSS feed

0.38.1

4 release files

0.38.0

4 release files

0.37.2

4 release files

0.36.3

4 release files

0.36.2

4 release files

0.36.1

4 release files

0.36.0

4 release files

0.35.0

4 release files

0.33.1

4 release files

0.33.0

4 release files

0.32.2

4 release files

0.32.1

4 release files

0.32.0

4 release files

0.31.4

4 release files

0.31.3

4 release files

0.31.1

4 release files

0.31.0

4 release files

0.30.2

4 release files

0.30.0

4 release files

0.29.2

4 release files

0.29.0

4 release files

0.28.1

4 release files

0.28.0

4 release files

0.27.2

4 release files

0.27.1

4 release files

0.27.0

4 release files

0.26.2

5 release files

0.26.1

5 release files

0.26.0

5 release files

0.25.1

5 release files

0.25.0

5 release files

0.24.0

5 release files

0.23.4

5 release files

0.23.3

5 release files

0.23.1

5 release files

0.23.0

5 release files

0.22.1

5 release files

0.21.0

5 release files

0.20.2

5 release files

0.20.1

5 release files

0.20.0

5 release files

0.19.0

5 release files

0.18.2

5 release files

0.18.1

5 release files

0.18.0

5 release files

0.16.1

5 release files

0.16.0

5 release files

0.15.1

5 release files

This release

0.15.0 This release

5 release files

0.14.1

4 release files

0.14.0

4 release files

0.13.0

4 release files

0.12.1

4 release files

0.11.0

4 release files

0.10.0

4 release files

0.9.1

4 release files

0.9.0

4 release files

0.8.2

4 release files

0.8.1

4 release files

0.8.0

4 release files

0.7.0

4 release files

0.6.0

4 release files

0.5.1

4 release files

0.5.0

4 release files

0.4.0

4 release files

0.3.1

4 release files

0.3.0

4 release files

0.2.0

3 release 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