Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Streamlit PyVista

PyPI version Read the Docs

A Streamlit component that allow support for new pyvista viewer backend : Trame.

Installation instructions

pip install streamlit-pyvista

Usage Instructions

import streamlit as st
from streamlit_pyvista.mesh_viewer_component import MeshViewerComponent


def main():
    st.title("Simple Streamlit App With Pyvista Viewer")

    mesh_viewer = MeshViewerComponent(
        "https://gitlab.com/dcsm/streamlit-pyvista/-/raw/main/examples/assets/plate_hole.vtu")
    mesh_viewer2 = MeshViewerComponent("assets/plate_hole.vtu")

    mesh_viewer.show()
    mesh_viewer2.show()


if __name__ == "__main__":
    main()

Note that instead of a file path or a url it's also possible to pass an array of link or path to display a sequence of files.

This viewer leverage the capabilities of the new pyvista backend Trame, beyond the nice design revamp, it also supports remote rendering.

Package documentation

You can find the automatic documentation generated with sphinx here

Workflow overview

This package has 3 different components:

  • The Streamlit component
  • The Trame viewers
  • A "Server manager"

Streamlit component

This pyvista new backend requires now to have its own server for each instance of a pyvista plotter. This means that the streamlit component can be as simple as an iframe and displayed in the app and can use a simple api to communicate with the trame server and the server manager

Trame viewers

The Trame viewers are the servers that are embedded in the streamlit app, it has exposed api endpoints that allow the component to communicate with the server for action such as loading a mesh in the viewer.

Server manager

As said earlier, the trame viewers can only display one plotter at a time which means that if we want to display multiple plotters we need multiple servers. The job of the Server manager is to control how many trame viewers exists, if they need to killed or if they can be reused for other viewers

Workflow

These 3 components interact the following manner:

  1. A MeshViewerComponent is created and notify a ServerManager that it needs a viewer.
  2. The ServerManager look if he have idling trame viewer anf if not, it start a new server.
  3. The ServerManager specify the endpoints of the server that can be used to the MeshViewerComponent
  4. The MeshViewerComponent directly communicate with the api of the trame viewer via the endpoints specified by the ServerManager

Download files

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

Source Distribution

streamlit_pyvista-0.0.21rc0.tar.gz (4.9 MB view details)

Uploaded Source

Built Distribution

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

streamlit_pyvista-0.0.21rc0-py3-none-any.whl (61.2 kB view details)

Uploaded Python 3

File details

Details for the file streamlit_pyvista-0.0.21rc0.tar.gz.

File metadata

  • Download URL: streamlit_pyvista-0.0.21rc0.tar.gz
  • Upload date:
  • Size: 4.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for streamlit_pyvista-0.0.21rc0.tar.gz
Algorithm Hash digest
SHA256 fd5c37f8fed93e0ea59ba81e519864a3881404f49d06231c8096ee2717101e36
MD5 546b1ff45d218aa139df74c05055d0cf
BLAKE2b-256 a0c6a2bd851ccd520e3f69a5d41fe084da26fcf5f9ef165d799111db45438603

See more details on using hashes here.

File details

Details for the file streamlit_pyvista-0.0.21rc0-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_pyvista-0.0.21rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb396087d9ac9e900c48898078d016da3a162c4abe438d0f7479c849a4455aca
MD5 cf038d50f51851a454726333f3d848c5
BLAKE2b-256 6147aace7e08d5354c3c329b1e668257268d2bc23e4caf4922e8929f47a199c8

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.21

2 files

This release

0.0.21rc0 This release

2 files

0.0.18

2 files

0.0.17

2 files

0.0.16

2 files

0.0.15

2 files

0.0.14

2 files

0.0.13

2 files

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page