- March 1, 2024
- Posted by: Dinesh Babu
- Categories:
Introduction To Streamlit
Streamlit is a free and open-source framework to rapidly build and share beautiful machine learning and data science web apps. It is a Python-based library specifically designed for machine learning engineers.
Why Streamlit?
Data scientists and machine learning engineers, distinct from web developers, might not be able to spend weeks mastering complex frameworks for web app development. Instead, they seek user-friendly tools that efficiently display data and collect necessary parameters for modeling. Streamlit offers a solution by allowing the creation of visually appealing applications with just a few lines of code, meeting their requirements effectively.
Why Snowflake?
Snowflake is a cloud-based data warehousing platform that allows organizations to store and analyze large volumes of data. It is known for its unique architecture, separating storage and compute resources, which enables scalable and flexible data processing. Snowflake’s multi-cluster, shared data architecture and support for various data formats make it popular for data analytics and business intelligence applications in diverse industries.
Snowflake has a command line feature to send emails to its users. This blog focuses on building a Graphical User Interface(GUI) leveraging the Snowflake email feature using Streamlit.
Prerequisites
- Streamlit installed on the local machine
- Any IDE ( VS code, etc)
- A Snowflake Account
Snow-mail Streamlit App:


Users just have to enter their account credentials and email content to send an email.
Major handlings
- Dynamic Secret File Handling
- Validating the Snowflake Account Credentials
- Without any prerequisites, Email can be sent with just a click.
Dynamic Secret File Handling
The app accepts Snowflake’s account credentials as input and builds the secret files dynamically every time an input is passed. Instead of configuring the secret file every time setup is done such a way to handle things dynamically so that users can just enter their account details and shoot an email.
Validating the Snowflake Account Credentials
The app has an option to validate the provided User Snowflake Credentials. As part of verification, it connects Snowflake and runs a select statement to validate the provided connection.
Without any prerequisites, Email can be sent with just a click
The actual process of sending an email also requires a Notification Integration creation. As part of the process, the app sets up a Notification Integration for the first time and uses that notification integration for the email feature.
Streamlit App Code:
The code used to build the Streamlit app can be found in this GitHub repo: https://github.com/dineshbabucittabase/streamlit/tree/main
Comments in the streamlit_sf_email_app.py file explain in depth about each portion of the code.
Cittabase is a select partner with Snowflake. Please feel free to contact us regarding your Snowflake solution needs. Our Snowflake and Streamlit solutions encompass a suite of services for your data integration, visualization and migration needs. We are committed to providing personalized assistance and support customized to your requirements.