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.22.1-cp38-abi3-win_amd64.whl (42.1 MB view details)

Uploaded CPython 3.8+ Windows x86-64

rerun_sdk-0.22.1-cp38-abi3-manylinux_2_31_x86_64.whl (51.4 MB view details)

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

rerun_sdk-0.22.1-cp38-abi3-manylinux_2_31_aarch64.whl (49.8 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.31+ ARM64

rerun_sdk-0.22.1-cp38-abi3-macosx_11_0_arm64.whl (44.6 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

rerun_sdk-0.22.1-cp38-abi3-macosx_10_12_x86_64.whl (46.8 MB view details)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

File details

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

File metadata

File hashes

Hashes for rerun_sdk-0.22.1-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d3d0afe1b8e749a1088a0bb75f372ad7fe70eb3728bd32e07bf78300436a053d
MD5 c9903ee07d326ba9eedc71ead45b2612
BLAKE2b-256 43ebedafdcba1619955c2c9b66c7a1bcbbce4ad62a1a36db984b46aa793fe366

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rerun_sdk-0.22.1-cp38-abi3-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 b9672412d0cdf57c79c10ca683e59716399da3358df78b985b25093d022ebbaf
MD5 e7bc4861b0d30bb53ee741a66e30bc8c
BLAKE2b-256 1edb3ce2be017d7d4ac0948fb064bf7417b36c96bc07d1b8a922017606ba03c6

See more details on using hashes here.

File details

Details for the file rerun_sdk-0.22.1-cp38-abi3-manylinux_2_31_aarch64.whl.

File metadata

File hashes

Hashes for rerun_sdk-0.22.1-cp38-abi3-manylinux_2_31_aarch64.whl
Algorithm Hash digest
SHA256 29d807909f5e484aa6427d9fb25706d0a154de392a4ca47eb303fbd135c0e382
MD5 9c4a5781dc11c111da808d5b4b3ecc80
BLAKE2b-256 ad4187079d0a897e4fc2dd54a356be9556626f40ec1ff1c3393178e7ac9feb9d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rerun_sdk-0.22.1-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dea4a50c916bc82bd97a8f9dc44c71f9a9fccec7e73f37edfaa0de800caf5dce
MD5 8f3d03d24ff4efc01653660c5c9fa257
BLAKE2b-256 018edb9fd7e7d9d9ec6e3f0781ce6f3b71c06952f9b0c40e9720822fd83f711e

See more details on using hashes here.

File details

Details for the file rerun_sdk-0.22.1-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for rerun_sdk-0.22.1-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 176853d14bcac0b3cab8b240fe6760e32a577b1edd9ecb2fd0656e83f046a2c4
MD5 adff858418b7981bd0333ac9e2d12a31
BLAKE2b-256 a941f9724c6ee4b4d45f9ae433f41fc8b4f2827d5b3f9459b9e9a9c55fdda5ab

See more details on using hashes here.

Supported by

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