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

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

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


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

Uploaded CPython 3.10+Windows x86-64

rerun_sdk-0.27.2-cp310-abi3-manylinux_2_28_x86_64.whl (114.6 MB view details)

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

rerun_sdk-0.27.2-cp310-abi3-manylinux_2_28_aarch64.whl (107.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

rerun_sdk-0.27.2-cp310-abi3-macosx_11_0_arm64.whl (100.0 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for rerun_sdk-0.27.2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d0437b73a807bb4643d3a7fee163e65e0df0459e6228eb2b087692610612ce99
MD5 87cc58a8ab6813828dd3447f10c4a490
BLAKE2b-256 d48b9fcb34b9d7bde9183372cc3dbaaca8d2ce49a43015e41dfe35bb62dfbef7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rerun_sdk-0.27.2-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5583f9d67b485e405939ddb1f9da38cc7202b326a15b1110d71dc7d2fdacc28b
MD5 914d1bc3e3b7758d4e2eb5f9066f36b0
BLAKE2b-256 2c6e0be74188a53af91572b466e6f672dae476b9058ca71c7d053e753a665087

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rerun_sdk-0.27.2-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 224d168b9673bf9237057db6beb62a3a63223d702602c2e57283089ed77acf42
MD5 56a0caafc187fa474a12e9ccaeacd0e8
BLAKE2b-256 e767ce06267c5fc5c7bb1cc027410a75cca0c5232afa1d4072ff2abe685cb923

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rerun_sdk-0.27.2-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e3e180a97085e7d7e1f1aee20c45f96173c87d723ce155573b96441733ef1560
MD5 c7022730fe24a708d061d0a2ce41c8ab
BLAKE2b-256 7def38ecd7fbb31b846d749299c2b848a30e85b7a6a7d496ea054373abfb3b08

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