Skip to main content

Trame interface for PyVista

Project description

trame-pyvista

Trame interface for PyVista. Provides web-based 3D viewers, Jupyter backends, scene exporters, and a Sphinx directive for embedding interactive plots in docs.

This package was extracted from the pyvista.trame subpackage so the trame stack can release on its own cadence. PyVista discovers installed functionality through entry points, so existing user code keeps working once trame-pyvista is installed.

Install

pip install trame-pyvista

For Jupyter:

pip install "trame-pyvista[jupyter]"

What you get

  • Jupyter backends: trame, server, client, html. Registered with PyVista via the pyvista.jupyter_backends entry-point group, so pv.set_jupyter_backend('trame') works once trame-pyvista is installed.

  • Plotter views: PyVistaLocalView, PyVistaRemoteView, PyVistaRemoteLocalView for embedding in trame apps.

  • plotter.trame namespace: registered as a PyVista plotter component so exporters live under the trame namespace:

    import pyvista as pv
    
    pl = pv.Plotter()
    pl.add_mesh(pv.Sphere())
    pl.trame.export_vtksz('scene.vtksz')
    pl.trame.export_html('scene.html')
    
  • Sphinx directive: trame_pyvista.sphinx_ext provides the offlineviewer directive used by PyVista docs to embed exported .vtksz scenes. Add to conf.py:

    extensions = ['trame_pyvista.sphinx_ext']
    

Usage

import pyvista as pv

pv.set_jupyter_backend('trame')
pl = pv.Plotter()
pl.add_mesh(pv.Wavelet())
pl.show()

Custom UI:

from trame_pyvista import plotter_ui

ui = plotter_ui(plotter, mode='trame')

See examples/ for runnable scripts covering local/remote views, custom UIs, and toolbar customization.

Development

Uses uv and just:

just sync         # create venv and install dev deps
just test         # unit tests
just test-playwright  # Sphinx + browser integration tests
just lint         # pre-commit (ruff, etc.)
just typecheck
just build

License

MIT. See LICENSE.

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

trame_pyvista-0.1.0.tar.gz (43.2 kB view details)

Uploaded Source

Built Distribution

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

trame_pyvista-0.1.0-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

Details for the file trame_pyvista-0.1.0.tar.gz.

File metadata

  • Download URL: trame_pyvista-0.1.0.tar.gz
  • Upload date:
  • Size: 43.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for trame_pyvista-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c98b567e0b514921b4e43d3f5eeda92989af0ce8a118f1659524d62d0bebdd0a
MD5 5fb7a5945c038e4f636939ab8ddc5467
BLAKE2b-256 f010778ca82ccc6f2d8f3644471da46a04ef578dfa9972fe469adc5fa5ea48db

See more details on using hashes here.

Provenance

The following attestation bundles were made for trame_pyvista-0.1.0.tar.gz:

Publisher: ci.yml on pyvista/trame-pyvista

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

File details

Details for the file trame_pyvista-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: trame_pyvista-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 28.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for trame_pyvista-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5786edefddc1ad2117ccc6496b565de60168a7bf9c2040698269c039a5957a3f
MD5 2189b86728337caa97db6789263163b9
BLAKE2b-256 697cbbd30bf633a4801287cb824e1cfe9de02e9bc794fe2d774d54aa97c8abb5

See more details on using hashes here.

Provenance

The following attestation bundles were made for trame_pyvista-0.1.0-py3-none-any.whl:

Publisher: ci.yml on pyvista/trame-pyvista

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