Skip to main content

Python bindings and notebook widget support for ruviz

Project description

ruviz for Python

ruviz for Python wraps the Rust plotting runtime with a fluent Python API, static export helpers, native desktop show(), and notebook widget support.

Install

pip install ruviz

If you want pandas or Polars dataframe inputs, install the optional dataframe extras:

pip install "ruviz[dataframes]"

Quick Start

import numpy as np
import ruviz

x = np.linspace(0.0, 4.0, 50)
y = x**2

(
    ruviz.plot()
    .line(x, y)
    .title("Quadratic")
    .xlabel("x")
    .ylabel("y = x^2")
    .save("quadratic.png")
)

Notebook and Desktop Usage

  • In Jupyter, plot.show() displays a static PNG in the cell output.
  • Use plot.widget() when you want the synced WASM-backed notebook widget.
  • plot.size_px(width, height) also controls the widget's displayed aspect ratio.
  • Outside notebooks, plot.show() opens the native interactive window.
  • plot.render_png() and plot.render_svg() return in-memory export data.

Reactive Notebook Data

Use ruviz.observable(...) for notebook-driven updates that keep widget state in sync:

import numpy as np
import ruviz

x = np.linspace(0.0, 6.0, 200)
y = ruviz.observable(np.sin(x))

plot = ruviz.plot().line(x, y).title("Live Sine Wave")
widget = plot.widget()

ObservableSeries supports elementwise arithmetic and NumPy ufuncs. Derived observables stay live until you write to them directly:

from copy import deepcopy
import numpy as np

scaled = np.sin(y * 2.0 + 0.25)
template = deepcopy(plot)

deepcopy(plot) creates an independent live copy with fresh observables, while plot.clone() remains a static snapshot copy.

Documentation

Contributor Workflow

cd python
uv sync
uv run maturin develop
uv run python scripts/generate_gallery.py
uv run mkdocs serve

Rebuild the bundled widget frontend from the repository root when you change the web SDK or packages/ruviz-web/src/python-widget.ts:

bun run build:python-widget

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ruviz-0.4.2.tar.gz (7.2 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ruviz-0.4.2-cp310-abi3-win_amd64.whl (6.8 MB view details)

Uploaded CPython 3.10+Windows x86-64

ruviz-0.4.2-cp310-abi3-macosx_11_0_arm64.whl (6.8 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

ruviz-0.4.2-cp310-abi3-macosx_10_12_x86_64.whl (7.0 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file ruviz-0.4.2.tar.gz.

File metadata

  • Download URL: ruviz-0.4.2.tar.gz
  • Upload date:
  • Size: 7.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ruviz-0.4.2.tar.gz
Algorithm Hash digest
SHA256 6786a4c9846b53334524a6b5104c98f8e721056889e20a92cb1ef2bd924b01ab
MD5 7a0cb70274387e0870d1c25cabfcecdf
BLAKE2b-256 070411a988497b045ab1ce32a7082163973f08493e710ecdb50cf9ea789e8dbd

See more details on using hashes here.

Provenance

The following attestation bundles were made for ruviz-0.4.2.tar.gz:

Publisher: release.yml on Ameyanagi/ruviz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ruviz-0.4.2-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: ruviz-0.4.2-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 6.8 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ruviz-0.4.2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 9c129f8e5710238bc95c1ba9d77b009408685b00d5aa519bbf58fedced673666
MD5 6d41172f1c87f4117124b8c08a826c07
BLAKE2b-256 35a2e1308175db56b5872ad59c2686bc0d55207c79b0fb4dd2d3902017506538

See more details on using hashes here.

Provenance

The following attestation bundles were made for ruviz-0.4.2-cp310-abi3-win_amd64.whl:

Publisher: release.yml on Ameyanagi/ruviz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ruviz-0.4.2-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ruviz-0.4.2-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1d3ada48004d2831d612a949d4a773238d35faffdabcedde62c955454bdc9144
MD5 3deed1edf4686756fc796c8f6c84a206
BLAKE2b-256 b83e6871d42877891d557deba1712a4c7d5f53863d22af803e3eebb11107030f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ruviz-0.4.2-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on Ameyanagi/ruviz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ruviz-0.4.2-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ruviz-0.4.2-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2f833e779067e68c3b8c3f8ff4dc17e856e2e6c3902985ba50a47b0638c1c820
MD5 330272a63100068b55dc2f09375e654d
BLAKE2b-256 a1505c6337c3a2315a19dd9bcc790c7167aa41e34171c88f8e7269c1a06ffa9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ruviz-0.4.2-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on Ameyanagi/ruviz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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