Streamlit PyVista
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:
- A
MeshViewerComponentis created and notify aServerManagerthat it needs a viewer. - The
ServerManagerlook if he have idling trame viewer anf if not, it start a new server. - The
ServerManagerspecify the endpoints of the server that can be used to theMeshViewerComponent - The
MeshViewerComponentdirectly communicate with the api of the trame viewer via the endpoints specified by theServerManager
Metadata
Release files for streamlit-pyvista 0.0.23
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| streamlit_pyvista-0.0.23.tar.gz | 4.9 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| streamlit_pyvista-0.0.23-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 4.9 MB
Release files / streamlit_pyvista-0.0.23.tar.gz
| Download URL | streamlit_pyvista-0.0.23.tar.gz |
|---|---|
| Size | 4.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
65aecac4352efe7cb57608d0e410c18990d14cdda8a8b3e1caa5661951340e2d
|
|
BLAKE2b-256 checksum How to use checksums |
f40bd67fada5c1644026fefd4267c113c33132d7392f4dae8bf92f8d46461950
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / streamlit_pyvista-0.0.23-py3-none-any.whl
| Download URL | streamlit_pyvista-0.0.23-py3-none-any.whl |
|---|---|
| Size | 61.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
55e3754d187d23ff016cc114f26c73d9ab9f995f850aa2f09f603e23789224e8
|
|
BLAKE2b-256 checksum How to use checksums |
245a3a194e785085a2c0edaff56c8b3888c9331162b3270fa0531fe26a875da5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Security for streamlit-pyvista 0.0.23
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.