> ## Content Index
> Fetch the complete content index at: https://www.daanalytics.nl/llms.txt
> Use this file to discover other available public pages before exploring further.

# Building My First Streamlit App on Snowflake
- URL: https://www.daanalytics.nl/my-first-streamlit-app-on-snowflake/
- Published: 2022-03-09T10:00:00.000Z
- Updated: 2026-08-28T10:02:41.000Z
- Author: Daan Bakboord
- Tags: Python & Streamlit, Snowflake, Python, Streamlit, Data Apps, #Historical technical article

💡

Originally published in 2022\. Snowflake, its user interface and the referenced integrations may have changed since publication. This article is retained for historical and educational context; verify implementation details against the current official documentation.

Last week I followed a Python Essentials course at [The School of Data Science](https://schoolofdatascience.nl/python-essentials-cursus/?ref=daanalytics.nl) in The Hague. At a certain point we discussed [Streamlit](https://streamlit.io/?ref=daanalytics.nl). This open-source framework could be a potential Power BI killer when it comes to visualising data and interacting with data. Interesting enough to check it out. It became even more interesting when I saw the following announcement the next day; [Snowflake to Acquire Streamlit](https://www.snowflake.com/blog/snowflake-to-acquire-streamlit/?ref=daanalytics.nl).

Before I will dive into the possibilities of Snowflake and Streamlit, I thought I would try out an easy example. Therefore I followed two examples from Snowflake and Streamlit and combined it to one example.

1. Getting started with Python - [link](https://quickstarts.snowflake.com/guide/getting%5Fstarted%5Fwith%5Fpython/index.html?ref=daanalytics.nl#0)
2. Connect Streamlit to Snowflake - [link](https://docs.streamlit.io/knowledge-base/tutorials/databases/snowflake?ref=daanalytics.nl)

## Setting up

First I had to make sure that I could use Python and Streamlit in combination with Snowflake. I have [Anaconda](https://www.anaconda.com/?ref=daanalytics.nl) installed on my local machine. Within Anaconda I have made a separate environment to check work this example out. In this environment I installed [Streamlit](https://anaconda.org/conda-forge/streamlit?ref=daanalytics.nl) and the [Snowflake Connector for Python](https://anaconda.org/conda-forge/snowflake-connector-python?ref=daanalytics.nl).

In combination with my Snowflake-account all should be in place to get things going.

## Getting Started with Python

Following the Getting started with Python-[guide](https://quickstarts.snowflake.com/guide/getting%5Fstarted%5Fwith%5Fpython/index.html?ref=daanalytics.nl#0), I'll make sure I can interact with Snowflake from Python. First I have to validate whether the connection from Python with Snowflake can be made. In the QuickStart you can see that the credentials are visible in the .py-file.

ctx = snowflake.connector.connect( user='<your\_user\_name>', password='<your\_password>', account='<your\_account\_name>' )

If you do not want that, there is an alternative solution with a separate file for the credentials and a reference to that file in the .py-file. I created a short example.

1. [Credentials](https://github.com/daanalytics/Snowflake/blob/master/python/SF%5Fcred.json?ref=daanalytics.nl)
2. [Validate](https://github.com/daanalytics/Snowflake/blob/master/python/SF%5Fvalidate.py?ref=daanalytics.nl)

In the *Credentials*\-file you can register the various components necassary to connect to Snowflake:

- account (mandatory)
- user (mandatory)
- warehouse
- role
- database
- schema
- password (mandatory)

From within the *Validate*\-file you can reference the *Credentials*\-file. First you specify the location of the the *Credentials*\-file. Then you make sure that the *Validate*\-file can read from the *Credentials*\-file. Then you create several variables (at least, username, password and account) with the information specified in the the *Credentials*\-file.

If you use this setup and you use version control like Git, make sure to put the credentials file in [*.gitignore*](https://www.atlassian.com/git/tutorials/saving-changes/gitignore?ref=daanalytics.nl).

## Creating my first Streamlit App

In [Github](https://github.com/daanalytics/Snowflake/blob/master/python/streamlit/myFirstSt.py?ref=daanalytics.nl) I uploaded my first Streamlit App. It's nothing more than a Python-script which consists of a few blocks:

- Setting up the connection to Snowflake
- Creating Snowflake-objects
- Loading Data
- Doing the Streamlit-magic

Finally running the Python-script; `streamlit run <path to Python-file>`

![](https://www.daanalytics.nl/content/images/2022/03/image-3.png)

## Made with Streamlit

![](https://www.daanalytics.nl/content/images/2022/03/image-1-2.png)

The end result of my first Streamlit app is a non-interactive web application. Just to see how easy it is to connect Python and Streamlit to Snowflake. In a following blogpost, I will find out how easy it is to make an interactive web application in Streamlit.

Thanks for reading and till next time.

[Daan Bakboord - DaAnalytics](https://www.linkedin.com/in/daanbakboord?ref=daanalytics.nl)