Skip to main content

The Rerun Logging SDK

Project description

The Rerun Python SDK

Use the Rerun SDK to record data like images, tensors, point clouds, and text. Data is 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.

For other SDK languages see Installing Rerun.

We also provide a Jupyter widget for interactive data visualization in Jupyter notebooks:

pip3 install rerun-sdk[notebook]

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 examples/python/plots/plots.py --connect

Note that SDK and Viewer can run on different machines!

Building Rerun from source

We use pixi for managing dev-tool versioning, download and task running. See here for installation instructions.

pixi run py-build

This builds the SDK for Python (use pixi run py-build --release for a release build).

You can then run examples via uv:

pixi run uv run examples/python/minimal/minimal.py

To build a wheel instead for manual install use:

pixi run py-build-wheel

Refer to BUILD.md for details on the various different build options of the Rerun Viewer and SDKs for all target languages.

Installing a pre-release

Prebuilt dev wheels from head of main are available at https://github.com/rerun-io/rerun/releases/tag/prerelease.

While we try to keep the main branch usable at all times, it may be unstable occasionally. Use at your own risk.

Running Python unit tests

pixi run py-test

If you run into a problem, run rm -rf .pixi .venv and try again.

Running specific Python unit tests

pixi run py-build && pixi run uvpy -m pytest rerun_py/tests/unit/test_tensor.py

Profiling the Python SDK

Set RERUN_PUFFIN=1 to spawn a puffin_viewer attached to the SDK on startup. The Rust side of the SDK then streams scopes (anything wrapped in re_tracing::profile_function! / profile_scope!) to the viewer for the lifetime of the process.

RERUN_PUFFIN=1 pixi run uvpy your_script.py

Save a recording from the viewer for offline analysis (use the investigate-puffin skill in .claude/skills/).

Project details


Release history Release notifications | RSS feed

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.34.0-cp310-abi3-win_amd64.whl (126.6 MB view details)

Uploaded CPython 3.10+Windows x86-64

rerun_sdk-0.34.0-cp310-abi3-manylinux_2_28_x86_64.whl (147.5 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64

rerun_sdk-0.34.0-cp310-abi3-manylinux_2_28_aarch64.whl (142.9 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

rerun_sdk-0.34.0-cp310-abi3-macosx_11_0_arm64.whl (133.6 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file rerun_sdk-0.34.0-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for rerun_sdk-0.34.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2b2ccb60cebb9b5fea9893415aad791447dffe8db89e45075d642446d94f8a5c
MD5 1f23f064c2057c37cfd23bd8f8cc5ce1
BLAKE2b-256 2b812481820e853f88493bd7cdb22a345f5fb7a6101c214a858be79693d4f1d4

See more details on using hashes here.

File details

Details for the file rerun_sdk-0.34.0-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rerun_sdk-0.34.0-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 75b87269a839aa2e3aeb0b1fbfb06c7f1e86d833fc63b92dd1935964476987e5
MD5 fa83beb635f9206f73f7104df19b9edb
BLAKE2b-256 0e10dda8cbcc4fc82eeff6cbf84042f7979f329fd768a010c47d5f11e855fb9b

See more details on using hashes here.

File details

Details for the file rerun_sdk-0.34.0-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for rerun_sdk-0.34.0-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 80fab3ec340f6f8f0ff2eb15a5df4985d0c8f0bf612eb030c1bc5abacf816f06
MD5 cfa86ba95e11727d46ec06abce7c9f89
BLAKE2b-256 2f1320eb2ba71564761f25f4eccb9330929e5ab912f0784850de890666024768

See more details on using hashes here.

File details

Details for the file rerun_sdk-0.34.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rerun_sdk-0.34.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9a66b55f60f7d052cdbde4c8899199a9d3d0c74057fccc55dbc1087e01aa27bb
MD5 eb43a15afd4164cd28ec99ad74e1fbf1
BLAKE2b-256 580aa69fc60fc2c8858ba0b41c5fd9aa6983f2a9c454a9b130c63130172550fd

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