# 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.
<p align="center">
<img width="800" alt="Rerun Viewer" src="https://github.com/rerun-io/rerun/assets/2624717/c4900538-fc3a-43b8-841a-8d226e7b5a2e">
</p>
## Install
```sh
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](https://www.rerun.io/docs/getting-started/installing-viewer).
We also provide a [Jupyter widget](https://pypi.org/project/rerun-notebook/) for interactive data visualization in Jupyter notebooks:
```sh
pip3 install rerun-sdk[notebook]
```
## Example
```py
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
* [Examples](https://www.rerun.io/examples)
* [Python API docs](https://ref.rerun.io/docs/python)
* [Quick start](https://www.rerun.io/docs/getting-started/quick-start/python)
* [Tutorial](https://www.rerun.io/docs/getting-started/data-in/python)
* [Troubleshooting](https://www.rerun.io/docs/getting-started/troubleshooting)
* [Discord Server](https://discord.com/invite/Gcm8BbTaAj)
## 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:
```sh
python3 -m rerun
```
In a second terminal, run the example with the `--connect` option:
```sh
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`](https://prefix.dev/) for managing dev-tool versioning, download and task running. See [here](https://github.com/casey/just#installation) for installation instructions.
```sh
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:
```sh
pixi run py-wheel --release
```
Refer to [BUILD.md](../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
```sh
pixi run -e py py-build && pixi run -e py py-test
```
Raw data
{
"_id": null,
"home_page": null,
"name": "rerun-sdk",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "computer-vision, logging, rerun",
"author": null,
"author_email": "\"Rerun.io\" <opensource@rerun.io>",
"download_url": null,
"platform": null,
"description": "# The Rerun Python SDK\n\nUse 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.\n\n<p align=\"center\">\n <img width=\"800\" alt=\"Rerun Viewer\" src=\"https://github.com/rerun-io/rerun/assets/2624717/c4900538-fc3a-43b8-841a-8d226e7b5a2e\">\n</p>\n\n## Install\n\n```sh\npip3 install rerun-sdk\n```\n\n\u2139\ufe0f Note:\nThe Python module is called `rerun`, while the package published on PyPI is `rerun-sdk`.\n\nFor other SDK languages see [Installing Rerun](https://www.rerun.io/docs/getting-started/installing-viewer).\n\nWe also provide a [Jupyter widget](https://pypi.org/project/rerun-notebook/) for interactive data visualization in Jupyter notebooks:\n```sh\npip3 install rerun-sdk[notebook]\n```\n\n## Example\n```py\nimport rerun as rr\nimport numpy as np\n\nrr.init(\"rerun_example_app\", spawn=True)\n\npositions = np.vstack([xyz.ravel() for xyz in np.mgrid[3 * [slice(-5, 5, 10j)]]]).T\ncolors = np.vstack([rgb.ravel() for rgb in np.mgrid[3 * [slice(0, 255, 10j)]]]).astype(np.uint8).T\n\nrr.log(\"points3d\", rr.Points3D(positions, colors=colors))\n```\n\n## Resources\n* [Examples](https://www.rerun.io/examples)\n* [Python API docs](https://ref.rerun.io/docs/python)\n* [Quick start](https://www.rerun.io/docs/getting-started/quick-start/python)\n* [Tutorial](https://www.rerun.io/docs/getting-started/data-in/python)\n* [Troubleshooting](https://www.rerun.io/docs/getting-started/troubleshooting)\n* [Discord Server](https://discord.com/invite/Gcm8BbTaAj)\n\n## Logging and viewing in different processes\n\nYou can run the Viewer and logger in different processes.\n\nIn one terminal, start up a Viewer with a server that the SDK can connect to:\n```sh\npython3 -m rerun\n```\n\nIn a second terminal, run the example with the `--connect` option:\n```sh\npython3 examples/python/plots/plots.py --connect\n```\nNote that SDK and Viewer can run on different machines!\n\n\n# Building Rerun from source\n\nWe use the [`pixi`](https://prefix.dev/) for managing dev-tool versioning, download and task running. See [here](https://github.com/casey/just#installation) for installation instructions.\n\n```sh\npixi run py-build --release\n```\nTo build SDK & Viewer for Python (or `pixi run py-build` for a debug build) and install it in the Pixi environment.\n\nYou 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`.\n\nRespectively, to build a wheel instead for manual install use:\n```sh\npixi run py-wheel --release\n```\n\nRefer to [BUILD.md](../BUILD.md) for details on the various different build options of the Rerun Viewer and SDKs for all target languages.\n\n\n# Installing a pre-release\n\nPrebuilt dev wheels from head of main are available at <https://github.com/rerun-io/rerun/releases/tag/prerelease>.\n\nWhile we try to keep the main branch usable at all times, it may be unstable occasionally. Use at your own risk.\n\n\n# Running Python unit tests\n```sh\npixi run -e py py-build && pixi run -e py py-test\n```\n\n",
"bugtrack_url": null,
"license": "MIT OR Apache-2.0",
"summary": "The Rerun Logging SDK",
"version": "0.21.0",
"project_urls": {
"documentation": "https://www.rerun.io/docs",
"homepage": "https://www.rerun.io",
"repository": "https://github.com/rerun-io/rerun"
},
"split_keywords": [
"computer-vision",
" logging",
" rerun"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "1a7b2dda703d2d234e8bf73edc11c099bc14c04b6bad6f748b76ad0525925dd9",
"md5": "66a598fa87061cb3a8c980af49e7f123",
"sha256": "1e454ceea31c70ae9ec1bb26eaa82828661b7657ab4d2261ca0b94006d6a1975"
},
"downloads": -1,
"filename": "rerun_sdk-0.21.0-cp38-abi3-macosx_10_12_x86_64.whl",
"has_sig": false,
"md5_digest": "66a598fa87061cb3a8c980af49e7f123",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 43464114,
"upload_time": "2024-12-18T14:11:28",
"upload_time_iso_8601": "2024-12-18T14:11:28.533971Z",
"url": "https://files.pythonhosted.org/packages/1a/7b/2dda703d2d234e8bf73edc11c099bc14c04b6bad6f748b76ad0525925dd9/rerun_sdk-0.21.0-cp38-abi3-macosx_10_12_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c711de8d1d375624edc7dae25a9d76b769cddb9090ca55b8fd7ce5f93b975cf5",
"md5": "03ad5797f5e450520228a3d1e2d45e70",
"sha256": "84ecb77b0b5bac71b53e849801ff073de89fcd2f1e0ca0da62fb18fcbeceadf0"
},
"downloads": -1,
"filename": "rerun_sdk-0.21.0-cp38-abi3-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "03ad5797f5e450520228a3d1e2d45e70",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 41643016,
"upload_time": "2024-12-18T14:11:37",
"upload_time_iso_8601": "2024-12-18T14:11:37.085362Z",
"url": "https://files.pythonhosted.org/packages/c7/11/de8d1d375624edc7dae25a9d76b769cddb9090ca55b8fd7ce5f93b975cf5/rerun_sdk-0.21.0-cp38-abi3-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "5349aefaa4f0e2ee685858aedaee2cc6cc4df8330055bdfbe88c6905e62d693d",
"md5": "52c202d04a52c02cda7307906e438aef",
"sha256": "919d921165c3238490dbe5bf00a062c68fdd2c54dc14aac6a1914c82edb5d9c8"
},
"downloads": -1,
"filename": "rerun_sdk-0.21.0-cp38-abi3-manylinux_2_31_aarch64.whl",
"has_sig": false,
"md5_digest": "52c202d04a52c02cda7307906e438aef",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 46355630,
"upload_time": "2024-12-18T14:11:44",
"upload_time_iso_8601": "2024-12-18T14:11:44.418695Z",
"url": "https://files.pythonhosted.org/packages/53/49/aefaa4f0e2ee685858aedaee2cc6cc4df8330055bdfbe88c6905e62d693d/rerun_sdk-0.21.0-cp38-abi3-manylinux_2_31_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "1063405a1b601cf1253878b1aebef6764095b2e8139cf233a908c2ccc4ad4ffd",
"md5": "7da35b425ed6079b993ad7baf67c3f19",
"sha256": "897649aadcab7014b78096f93c84c61c00a227b80adaf0dec279924b5aab53d8"
},
"downloads": -1,
"filename": "rerun_sdk-0.21.0-cp38-abi3-manylinux_2_31_x86_64.whl",
"has_sig": false,
"md5_digest": "7da35b425ed6079b993ad7baf67c3f19",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 47790175,
"upload_time": "2024-12-18T14:11:52",
"upload_time_iso_8601": "2024-12-18T14:11:52.303076Z",
"url": "https://files.pythonhosted.org/packages/10/63/405a1b601cf1253878b1aebef6764095b2e8139cf233a908c2ccc4ad4ffd/rerun_sdk-0.21.0-cp38-abi3-manylinux_2_31_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "875ec7cf6379a7a42748f5961ec41faf0e38635c6e6d5cd95b63a2691f0b34dc",
"md5": "22a60c3ffc6fb96c426f5f272fe28817",
"sha256": "2060bdb536a198f0f04789ba5ba771e66587e7851d668b3dfab257a5efa16819"
},
"downloads": -1,
"filename": "rerun_sdk-0.21.0-cp38-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "22a60c3ffc6fb96c426f5f272fe28817",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 39216574,
"upload_time": "2024-12-18T14:12:00",
"upload_time_iso_8601": "2024-12-18T14:12:00.638135Z",
"url": "https://files.pythonhosted.org/packages/87/5e/c7cf6379a7a42748f5961ec41faf0e38635c6e6d5cd95b63a2691f0b34dc/rerun_sdk-0.21.0-cp38-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-18 14:11:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rerun-io",
"github_project": "rerun",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "rerun-sdk"
}