Skip to main content

The Rerun Logging SDK

Project description

The Rerun Python Log SDK

Rerun is an SDK for logging computer vision and robotics data paired with a visualizer for exploring that data over time. It lets you debug and understand the internal state and data of your systems with minimal code.

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.spawn()

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_points("my_points", positions=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/car/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.69.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!
just py-build

Test

# Run the unit tests
just py-test

# Run the linting checks
just py-lint

# Run an example
python examples/python/car/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/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.69

If you want to switch back, this is how:

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

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

Uploaded CPython 3.8+Windows x86-64

rerun_sdk-0.7.0-cp38-abi3-manylinux_2_31_x86_64.whl (26.5 MB view details)

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

rerun_sdk-0.7.0-cp38-abi3-macosx_11_0_arm64.whl (21.5 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

rerun_sdk-0.7.0-cp38-abi3-macosx_10_7_x86_64.whl (22.5 MB view details)

Uploaded CPython 3.8+macOS 10.7+ x86-64

File details

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

File metadata

  • Download URL: rerun_sdk-0.7.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 20.7 MB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.1.0

File hashes

Hashes for rerun_sdk-0.7.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2a96f2d69d10276aff4ec751a3a0ac40ea724c12596c9f08c22d0e6011d1ecbe
MD5 38d1e8a8650fe0c8c91301efc17b93cd
BLAKE2b-256 d30a6e5b0fd38c8604ae514283076803a4550a38ac400e5465e5d9d3d1d30bad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rerun_sdk-0.7.0-cp38-abi3-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 36a79c1e750a295134a54632cbc1cec986b0c635505ccac5c1c11a1b74cae577
MD5 3d3dd325a619df3c53062636d720bba5
BLAKE2b-256 f653512d4e4d7836deb2ca2de9837a79dbd290e8cf57aece8c598c429dd15468

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rerun_sdk-0.7.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 be404609d05a16b1d1a5b6299e08afdc10f7e5515db3d74c919806167c121fd9
MD5 91da21aab799d1c89120326dac4326dd
BLAKE2b-256 621f465db1b68b2074b420f9a854283092916945f1ef48d195048dca6c089bc3

See more details on using hashes here.

File details

Details for the file rerun_sdk-0.7.0-cp38-abi3-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for rerun_sdk-0.7.0-cp38-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 ede96639f5a47293c566171aa6235b07a9520f4749a9f0623113703472cdb344
MD5 838b6d534480e6c5f37c2f67c0bda8d7
BLAKE2b-256 46d2f4313ce830a0c7db4b339f5ce50515e91a0fbc84b7a878defd5cf87a7fa5

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