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 the pixi for managing dev-tool versioning, download and task running. See here for installation instructions.

pixi run py-build --release

To build SDK & Viewer for Python (or pixi run py-build for a debug build) and install it in the Pixi environment.

You can then run examples from the repository, either by making the Pixi shell active with pixi shell -e py and then running Python or by using pixi run -e py, e.g. pixi run -e py python examples/python/minimal/minimal.py.

Respectively, to build a wheel instead for manual install use:

pixi run py-wheel --release

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 -e py py-build && pixi run -e py py-test

Running specific Python unit tests

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

Project details


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

rerun_sdk-0.23.4-cp39-abi3-win_amd64.whl (50.9 MB view details)

Uploaded CPython 3.9+Windows x86-64

rerun_sdk-0.23.4-cp39-abi3-manylinux_2_28_x86_64.whl (64.9 MB view details)

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

rerun_sdk-0.23.4-cp39-abi3-manylinux_2_28_aarch64.whl (61.6 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

rerun_sdk-0.23.4-cp39-abi3-macosx_11_0_arm64.whl (55.1 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

rerun_sdk-0.23.4-cp39-abi3-macosx_10_12_x86_64.whl (59.5 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file rerun_sdk-0.23.4-cp39-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for rerun_sdk-0.23.4-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1c3a2480892a09165183d38788ea238a4689aaf61f3c388539aa74e1514df23c
MD5 b86772f200f81e15ecb217287bb13a72
BLAKE2b-256 d9e698923b167df0388da2acea1a4a8cc5fdd4557c0ada25fd79a704d614ce09

See more details on using hashes here.

File details

Details for the file rerun_sdk-0.23.4-cp39-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rerun_sdk-0.23.4-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 229b5f12a4f6499e2575ace3a9bbc3d164245a65224789d7e3ebc5656b01538d
MD5 30ed367101c54218fdda045ae550e026
BLAKE2b-256 135c5c194619bbdc9545832f50bf94634fc9f548cf8f08eada76446dffce8d8d

See more details on using hashes here.

File details

Details for the file rerun_sdk-0.23.4-cp39-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for rerun_sdk-0.23.4-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2aec8c65d2f1fee0df4b145389fab23fe91c7f07a3ed0b6d2003c177c3437ca4
MD5 41d9bd0566120e7f55e7bba78c23a322
BLAKE2b-256 2fd29809c34f486cd402ad34287efaf1f546052e7876d66821aa152a23e9cd84

See more details on using hashes here.

File details

Details for the file rerun_sdk-0.23.4-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rerun_sdk-0.23.4-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e2fbded870b50058052a6e03fe890d268f77dc19d5dec171b48b524c61199256
MD5 5af4cdd8f0a80b0d35497e154ad6dc71
BLAKE2b-256 2c3964ea3c404239bd709e76bc36e321dbb1343dbf84ec918480a1b87ce63a85

See more details on using hashes here.

File details

Details for the file rerun_sdk-0.23.4-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for rerun_sdk-0.23.4-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3d18fdbf6f7d4fb2bb271dbbeecf1c9c2c8cdbf348b9e59a2bcd36f9c2f44df1
MD5 a231bdc62b799d9a089238b11e930741
BLAKE2b-256 f07fd77608b6c73e43bbc67a86510e43573b8c03abac80b7341d15f677818e9c

See more details on using hashes here.

Supported by

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