Giter VIP home page Giter VIP logo

snowflake-csv-uploader's Introduction

Snowflake Spreadsheet Uploader

This a demo showcasing various capabilities of Streamlit applications built on Snowflake:

  • Directly upload data from spreadsheets (.csv, .xlsx) into Snowflake tables
  • Visualisations
  • Data & file validation
  • Caching / Memoization

Setup

Prerequisities

You will need the following:

  • Snowflake account. We highly recommend creating a trial account over any production accounts.
  • Snowflake role with CREATE DATABASE and CREATE TABLE privileges. If using a trial account, the SYSADMIN role is sufficient for this exercise.

If running this on your own machine, you will need either:

  • Python3.8
  • Docker

Code and deployment has been tested and verified on Gitpod

Please Note

The Streamlit code creates a few objects within your Snowflake account:

  • A Database: SNOWFLAKE_LAB_ONLINE_RETAIL
  • A Table: SNOWFLAKE_LAB_ONLINE_RETAIL.PUBLIC.TRANSACTIONS

Set up Credentials

This sets up the connection from your Streamlit app to your Snowflake account. Make a copy of the included ./.streamlit/secrets_example.toml file:

cp ./.streamlit/secrets_example.toml ./.streamlit/secrets.toml

Substitute each value with values applicable for your Snowflake demo account

Running your Streamlit Application

Option 1: Python on Docker

Simply build & run the image with the following:

docker build -f Dockerfile -t snowflake-csv-uploader .

# Run
docker run -it \
    -p 8501:8501 \
    -v "$PWD":/app \
    -w /app \
    snowflake-csv-uploader

Assuming everything is run and configured correctly, you will be given a URL link to the app running.

Option 2: Python

(Optional, but recommended) Create a virtualenv

python3 -m venv ./snowflake-csv-uploader-env
source ./snowflake-csv-uploader-env/bin/activate

Install required packages:

pip3 install -r requirements.txt

Run your app

streamlit run streamlit_app.py

Assuming everything is run and configured correctly, you will be given a URL link to the app running

snowflake-csv-uploader's People

Contributors

sfc-gh-sekim avatar sfc-gh-alei avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.