Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deephaven/streamlit-deephaven
Deephaven Streamlit custom component
https://github.com/deephaven/streamlit-deephaven
streamlit-component
Last synced: 27 days ago
JSON representation
Deephaven Streamlit custom component
- Host: GitHub
- URL: https://github.com/deephaven/streamlit-deephaven
- Owner: deephaven
- License: mit
- Created: 2023-04-06T15:16:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-30T20:38:16.000Z (7 months ago)
- Last Synced: 2024-11-28T16:53:57.312Z (about 1 month ago)
- Topics: streamlit-component
- Language: Python
- Homepage:
- Size: 657 KB
- Stars: 2
- Watchers: 11
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Deephaven Streamlit Component
This component displays Deephaven widgets within Streamlit.
## Quickstart
1. In a new folder, set up your [Streamlit environment](https://docs.streamlit.io/library/get-started/installation) and install the `streamlit-deephaven` package:
```
python -m venv .venv
source .venv/bin/activate
pip install streamlit-deephaven
```2. Create your first deephaven application, named `deephaven_app.py`:
```
import streamlit as st
from streamlit_deephaven import start_server, display_dh# Start the Deephaven server. You must start the server before running any Deephaven operations.
start_server()st.subheader("Streamlit Deephaven")
# Create a simple table.
from deephaven import empty_table
t = empty_table(1000).update(["x=i", "y=x * x"])# Display the table.
display_dh(t)
```3. Run the streamlit application:
```
streamlit run deephaven_app.py
```## Alternate Deephaven Server URL
By default, the Deephaven server is located at `http://localhost:{port}`, where `{port}` is the port set in the Deephaven server creation call. If the server is not there, such as when running Streamlit in a Docker container, modify the `DEEPHAVEN_ST_URL` environmental variable to the correct URL before calling `display_dh`.
```python
import os
os.environ["DEEPHAVEN_ST_URL"] = "http://localhost:1234"
```For more information on running Streamlit, see the [Streamlit documentation](https://docs.streamlit.io/).
## Development
See [development guide](./development.md) for instructions on how to develop this package.