Running Arbitrary Code
Hosting Streamlit Apps
Beam supports hosting Streamlit apps. This example shows how to deploy a Streamlit app that analyzes the water consumption in New York City.
Streamlit App Structure
There are two components to deploying a Streamlit app on Beam:
- An
streamlit_server.py
file with your Beam code. You can view the source code here. - A
app.py
file that hosts the Streamlit app
Here’s what the Beam-specific code looks like:
app.py
Deploying the Streamlit App
To deploy the app, run the following command:
This will deploy the Streamlit app and print the URL to the console:
You can paste the URL into your browser to use the app!
Was this page helpful?