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
lists = client.lists.all(get_all=True, fields="lists.name,lists.id")['lists'] | |
#get_all intends to provide you with all the available lists | |
#fields are the collumns you want to extract |
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_redshift as pr | |
pr.connect_to_redshift(dbname = 'YOU_DATABASE', host = 'YOUR_HOST', port = 'YOUR_PORT', | |
user = 'YOUR_USER', password = 'YOUR PASSWORD') | |
pr.connect_to_s3(aws_access_key_id = 'YOUR_ACCESS_KEY_ID', aws_secret_access_key = 'YOUR_aCCESS_KEY', | |
bucket = 'BUCKET_TO_LOAD') | |
pr.pandas_to_redshift(data_frame = 'DATA_FRAME_TO_LOAD', redshift_table_name = 'TABLE_IN_REDSHIFT_TO_LOAD') | |
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
fields = 'members.client,members.last_changed,members.list_id,members.rating,members.email_address,members.merge_fields.uuid,members.stats,members.status,members.member_rating,members.timestamp_opt' | |
client.lists.members.all(list_id = '29hfkl23' , count = 20, offset = 0 , fields = fields)['members'] |
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
from mailchimp3 import MailChimp | |
import pandas as pd | |
client = MailChimp(mc_api='YOUR_API_KEY', mc_user='YOUR_USERNAME') |