Development Status
- 4 - Beta
Intended Audience
- Science/Research
Operating System
- MacOS
- POSIX :: Linux
- Microsoft :: Windows
Programming Language
- Python :: 3
- Python :: 3.10
- Python :: 3.11
- Python :: 3.12
- Python :: 3.13
Topic
- Scientific/Engineering :: Visualization
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 thepyvista.jupyter_backendsentry-point group, sopv.set_jupyter_backend('trame')works oncetrame-pyvistais installed. -
Plotter views:
PyVistaLocalView,PyVistaRemoteView,PyVistaRemoteLocalViewfor embedding in trame apps. -
plotter.tramenamespace: 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_extprovides theofflineviewerdirective used by PyVista docs to embed exported.vtkszscenes. Add toconf.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
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.