Back to Rerun

External importer example

examples/python/external_importer/README.md

0.32.01.7 KB
Original Source
<picture> <source media="(max-width: 480px)" srcset="https://static.rerun.io/external_data_loader_py/6c5609f5dd7d1de373c81babe19221b72d616da3/480w.png"> <source media="(max-width: 768px)" srcset="https://static.rerun.io/external_data_loader_py/6c5609f5dd7d1de373c81babe19221b72d616da3/768w.png"> <source media="(max-width: 1024px)" srcset="https://static.rerun.io/external_data_loader_py/6c5609f5dd7d1de373c81babe19221b72d616da3/1024w.png"> <source media="(max-width: 1200px)" srcset="https://static.rerun.io/external_data_loader_py/6c5609f5dd7d1de373c81babe19221b72d616da3/1200w.png"> </picture>

This is an example executable importer plugin for the Rerun Viewer.

It will log Python source code files as markdown documents.

On Linux & Mac you can simply copy it in your $PATH as rerun-importer-python-file.py, then open a Python source file with Rerun (rerun file.py). Make sure the file has a shebang (#!/usr/bin/env python3) and is executable (chmod +x).

On Windows you have to install the script as an executable first and then put the executable under %PATH%. One way to do this is to use pyinstaller: pyinstaller .\examples\python\external_importer\rerun-importer-python-file.py -n rerun-importer-python-file --onefile

Consider using the send_columns API for importers that ingest time series data from a file. This can be much more efficient that the stateful log API as it allows bundling component data over time into a single call consuming a continuous block of memory.