This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
from StringIO import StringIO | |
def write_df_to_s3(df, s3_bucket, s3_key, encoding='utf-8', index=False, **kwargs): | |
""" | |
Writes a pandas dataframe to a csv on AWS S3 | |
Arguments: | |
df (pd.DataFrame): dataframe to write | |
s3_bucket (str): s3 bucket name, e.g. "my-bucket" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from sqlalchemy import create_engine | |
# follows django database settings format, replace with your own settings | |
DATABASES = { | |
'production':{ | |
'NAME': 'dbname', | |
'USER': 'user', | |
'PASSWORD': 'pass', | |
'HOST': 'rdsname.clqksfdibzsj.us-east-1.rds.amazonaws.com', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
creates local settings for a django project | |
- define secret key | |
- use a local sqlite3 database | |
reference: http://stackoverflow.com/questions/4909958/django-local-settings | |
''' | |
import os |
NewerOlder