This QuickStart will guide you through the implementation of a quick, easy, and rapid to develop method to embed Sigma content in a Streamlit application. Embedding Sigma content within Streamlit applications is a powerful tool-set that enables and empowers developers, data analysts, and even business users to create interactive data applications backed by the power of Sigma.
Streamlit is an open source app framework in Python language. It will help us to create interactive web apps for data science and machine learning in a short time. It is compatible with all major Python libraries, such as scikit-learn, Keras, PyTorch, SymPy(latex), NumPy, pandas, Matplotlib, and more.
Streamlit is intended to provide Snowflake users the ability to rapidly deploy applications and share data.
Teams use Streamlit to build Python applications to benefit from:
Streamlit works great with Sigma to accelerate your path of deployment for any data applications built, especially those that rely on visualizations, while providing the user with our industry-differentiated ability to deep dive into the data powering those visuals and unlocking the power of your data warehouse.
Building the analytics front-end In Sigma provides:
Snowflake customers who are using (or interested in using) Streamlit and want to also embed Sigma content in a Streamlit application. Sigma customer who are looking to rapidly develop and deploy data applications in Streamlit.
What is Snowflake Streamlit and how can we embed Sigma content into it.
We will use Streamlit and Sigma to build a webpage that embed a Sigma dashboard:
We will start by setting up our local Python environment based on Miniconda, which is a "thin" version of Conda (Anaconda). If you already have an existing Python environment, you may make use of that or proceed with Miniconda as well.
Conda is an open-source, cross-platform, language-agnostic package manager and environment management system. It was originally developed to solve difficult package management challenges faced by Python data scientists, and today is a popular package manager for Python and R.
Miniconda is the much smaller (~200 MB vs. ~4+ GB) installer version of Conda and will save us time and disk-space compared with installing the full Conda application.
It includes only Conda, Python, the packages they depend on, and a small number of other useful packages, including pip, zlib and a few others. Packages that are not included, have to be called at runtime or installed individually.
Use the following link to download the Miniconda. Download the version that includes Python 3.8 or above based on your operating system and its processor (x86 32 bit or 64 bit, Apple Silicon, or etc.)
Use the following link to download the Miniconda. Download the version that includes Python 3.8 or above based on your operating system and its configuration (32 bit or 64 bit).
After downloading the operation system appropriate version from Miniconda, go ahead and run the installation, accepting the license and all the defaults.
Now that Miniconda is installed (along with our selected version of Python; v3.8), we can move to the next step.
Install VSCode from Microsoft's download site.
Run the installation with all defaults.
Once the software is installed, we need to configure it for our use case.
Open VSCode and click the sidebar icon for
Python and select the extension from the list as shown. Click
Link to Pylance Extension page.
We now have a development environment ready, but we need to do a few more steps.
Since we installed Miniconda, every available Conda package is not present in our system. While this saves install time and saves disk-space, we will have to be aware that each VScode project will need to have required package dependencies installed at runtime.
We could solve this by installing packages globally but we prefer to avoid that and maintain tight control of our development environment.
To properly support this control, we will make use of
Python environments to create project/package isolation.
For our first project, we will create a Python environment called
In our local computer, navigate to where Miniconda is installed. The default is based on your computer username.
Right-click and open a terminal session:
First, let's see what environments already exist. Run the command:
conda env list
We should see the "base" environment that is included with Miniconda.
Now let's create our "streamlit" environment for our VSCode project. Run the command:
conda create --name streamlit python=3.8
When prompted to proceed, type
y and hit return:
We need to activate our new environment. Run the command:
conda activate streamlit
Listing the environments again, we should see
streamlit being the current select noted by the "*":
conda env list
We are ready with our new Conda environment called
To install Streamlit on our local computer, execute the following command in Terminal:
pip install streamlit
A lot of information will be displayed and the command prompt will appear when done. There should be no error messages:
Now we can test our local Streamlit environment. Execute the following command in Terminal:
Allow button to allow Python to accept incoming network connections:
The following prompt should appear in terminal asking for email address (we will skip over that, so leave it blank and press
Streamlit will automatically open your default browser to the standard webpage that comes with Streamlit:
We need to select the Python interpreter we want to use for our project.
Access the VSCode editor commands.
Ctrl+Shift+P will bring you directly to the editor commands.
In the editor bar, type
select inter and you should see
Python: Select Interpreter listed. Select that.
There may by a few versions installed (depending on your system) and we want to select the one that is based on our
We can tell which that is as it will say
After restart (if required), VSCode will revert to the default Python environment so change that back to
Make sure that the Python Interpreter selected in blue is
streamlit, indicating that it is active.
We are now setup to get build a Python webpage for Streamlit using VSCode.
Using the VSCode button (or the file menu if you dont see the button), click to
Navigate to where you installed Streamlit and select that top-level folder:
Right-click on new file icon (as shown) to create a blank new file:
Name the new file
hello-world.py and paste the following code in editor for this new file:
import streamlit as st st.write("Hello, World!")
Save the file.
Open a new Terminal session inside VSCode:
In the VSCode Terminal session, execute the following command:
streamlit run hello_world.py
Streamlit will open in your default browser with our new webpage:
We are now ready to embed Sigma into our new Streamlit page.
We will need something to embed into Streamlit from Sigma. To keep this simple, we will use a Public Embed of the Sales Performance Example Template.
Log into Sigma (as Administrator) and navigate to
Templates and click the Sales Performance Example Template:
Dismiss the pop-up help regarding swapping of data sources. We will just use the sample data provided.
Save As button in the upper right corner and use the name
Sigma Dashboard; click
Now click the drop menu (as shown below) and select
Embed workbook pop-up, click the
Public tab and then the drop arrow followed by the
Dashboard. This will define all the elements on the Workbook's Dashboard page to be embedded.
Once we selected to embed the Dashboard, we are presented with both a Public Link to the content as well as the Embed Code.
Copy to select the
Public Link and paste it into a text file; we will use it in the next step:
In VSCode, we are going to delete the code in our "hello_world.py" file with this code:
import streamlit as st st.write("Hello, World!") st.components.v1.iframe("REPLACE WITH PATH TO YOUR SIGMA PUBIC EMBED")
You may have noticed that the code is the identical but extended with a call to the st.components.v1.iframe function to add the required iframe.
Save the new code and refresh the browser page to see the embedded Sigma content:
Congratulations, you have setup your Streamlit app with Sigma embedded into it.
In this lab we learned what is Streamlit and how to Embed Sigma into Streamlit application that we built together.
If you would like to learn more about Streamlit, there is a video series available.
Additional Resource Links
Be sure to check out all the latest developments at Sigma's First Friday Feature page!
Get started with Streamlit
Help Center Home