Skip to content

Initialization

def rerun.init(application_id, spawn=False, default_enabled=True)

Initialize the Rerun SDK with a user-chosen application id (name).

Parameters:

Name Type Description Default
application_id str

Your Rerun recordings will be categorized by this application id, so try to pick a unique one for each application that uses the Rerun SDK.

For example, if you have one application doing object detection and another doing camera calibration, you could have rerun.init("object_detector") and rerun.init("calibrator").

required
spawn bool

Spawn a Rerun Viewer and stream logging data to it. Short for calling spawn separately. If you don't call this, log events will be buffered indefinitely until you call either connect, show, or save

False
default_enabled bool

Should Rerun logging be on by default? Can overridden with the RERUN env-var, e.g. RERUN=on or RERUN=off.

True

def rerun.connect(addr=None)

Connect to a remote Rerun Viewer on the given ip:port.

Requires that you first start a Rerun Viewer, e.g. with 'python -m rerun'

Parameters:

Name Type Description Default
addr Optional[str]

The ip:port to connect to

None

def rerun.disconnect()

Disconnect from the remote rerun server (if any).

def rerun.spawn(port=9876, connect=True)

Spawn a Rerun Viewer, listening on the given port.

This is often the easiest and best way to use Rerun. Just call this once at the start of your program.

You can also call rerun.init with a spawn=True argument.

Parameters:

Name Type Description Default
port int

The port to listen on.

9876
connect bool

also connect to the viewer and stream logging data to it.

True

def rerun.serve(open_browser=True)

Serve a Rerun Web Viewer.

WARNING: This is an experimental feature.

Parameters:

Name Type Description Default
open_browser bool

Open the default browser to the viewer.

True