Skip to content

Instantly share code, notes, and snippets.

View silberman's full-sized avatar

Dan Silberman silberman

View GitHub Profile
"""
Python2 example script for loading data from a .csv file into your Mozart Snowflake instance.
To use, specify the 7 constants defined at the top:
SNOWFLAKE_ACCOUNT, SNOWFLAKE_USERNAME, SNOWFLAKE_PASSWORD, and SNOWFLAKE_DATABASE come from https://app.mozartdata.com/export/mode
TARGET_SCHEMA and TARGET_TABLE are where we'll be writing to
CSV_FILEPATH is the full path to the csv file we'll be uploading
"""
Example script for loading data from a .csv file into your Mozart Snowflake instance.
To use, specify the 6 constants defined at the top:
SNOWFLAKE_ACCOUNT, SNOWFLAKE_USERNAME, SNOWFLAKE_PASSWORD, and SNOWFLAKE_DATABASE come from https://app.mozartdata.com/integrations/mode
TARGET_SCHEMA and TARGET_TABLE are where we'll be writing to
CSV_FILEPATH is the full path to the csv file we'll be uploading
Install snowflake-sqlalchemy: https://docs.snowflake.com/en/user-guide/sqlalchemy.html#installing-snowflake-sqlalchemy
tldr: pip install --upgrade snowflake-sqlalchemy