AWS Project: Data Migration to Snowflake

Description: Led a project to migrate data from legacy systems to the Snowflake platform on AWS. Developed Python scripts for data extraction, transformation, and loading using AWS Glue and S3 for storage.

import boto3
import pandas as pd
from snowflake.connector import connect, DataFrameCursor

# Establish connection to Snowflake
conn = connect(
    user='username',
    password='password',
    account='account_id',
    warehouse='warehouse_name',
    database='database_name',
    schema='schema_name'
)
cursor = conn.cursor()

# Extract data from AWS S3
s3 = boto3.client('s3')
bucket_name = 'bucket_name'
key = 'data.csv'
obj = s3.get_object(Bucket=bucket_name, Key=key)
data = pd.read_csv(obj['Body'])

# Transform data (if needed)
# Load data into Snowflake
cursor.execute('CREATE OR REPLACE TABLE table_name (...)')
cursor.execute('INSERT INTO table_name VALUES (...)')
conn.commit()