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 size and aspect ratio.
  • In the widget, right click opens the export menu and right drag performs box zoom.
  • Outside notebooks, plot.show() opens the native interactive window.
  • The published Linux wheel focuses on static rendering and notebook widgets. Install from source on Linux if you need the native desktop plot.show() 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.5.tar.gz (4.6 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.5-cp310-abi3-win_amd64.whl (6.8 MB view details)

Uploaded CPython 3.10+Windows x86-64

ruviz-0.4.5-cp310-abi3-manylinux_2_28_x86_64.whl (6.8 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.10+macOS 11.0+ ARM64

ruviz-0.4.5-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.5.tar.gz.

File metadata

  • Download URL: ruviz-0.4.5.tar.gz
  • Upload date:
  • Size: 4.6 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.5.tar.gz
Algorithm Hash digest
SHA256 41a7a7dd8ffcacbd41848c39f32e9e31529e064074953fd1045fad291d03c9d6
MD5 d0b6d144aefe08450b1515f727749d14
BLAKE2b-256 300cbb8f0e5ce71833b867af0963b6ecdfcfb639c81144604d25a259d7ce2293

See more details on using hashes here.

Provenance

The following attestation bundles were made for ruviz-0.4.5.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.5-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: ruviz-0.4.5-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.5-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ad55a7fd6771a843f82b1b7c6f968f93bde345d8f2b213555caefb400427430b
MD5 6408dbe373616f4cf916ede629192421
BLAKE2b-256 e7ccf27ad6ece210ca12fcc42ea163fb391b1121b3b9b3b076efcc97eafd5c64

See more details on using hashes here.

Provenance

The following attestation bundles were made for ruviz-0.4.5-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.5-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ruviz-0.4.5-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ee9ff1b74feeadc68c50e9c766f248bfd7943f3a64e8ee2e1f882015feb6ae54
MD5 0ae7a394ebe91daddf151585a97277f4
BLAKE2b-256 f6cf1748eb18afb9c5eddfcbd4637438be63ad02446a465fa5ff07c5366cd0af

See more details on using hashes here.

Provenance

The following attestation bundles were made for ruviz-0.4.5-cp310-abi3-manylinux_2_28_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.

File details

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

File metadata

File hashes

Hashes for ruviz-0.4.5-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 415746622089a91b67c109949c46d9698b98844480a3329014f77e0a36a10161
MD5 d49ced5cd3c1741a32a8343e7251aee3
BLAKE2b-256 4178f13647f01371475c04e408ade5e0d852058e1ab3dbfa1fe572f31df60cee

See more details on using hashes here.

Provenance

The following attestation bundles were made for ruviz-0.4.5-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.5-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ruviz-0.4.5-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 aad9bc8f7ab63769962a4ea52f7fb929f8955fb5b335a594c1ea92436289b24e
MD5 e666a19dd023c4e0226452a073666f2b
BLAKE2b-256 b9276178b60db0c80cd922e32ad4bd67529bfb2aeba671ec439b7d40e6895b88

See more details on using hashes here.

Provenance

The following attestation bundles were made for ruviz-0.4.5-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