date=NOWDATECDC + 'T00:00:00.000') dfCountyResults = pd.DataFrame.from_records(countyResults) dfCountyResults.to_csv(dst + '\\cdc_vaccine_counties.csv') stateResults = client.get('unsk-b7fc', limit=2000, date=NOWDATECDC + 'T00:00:00.000') dfStateResults = pd.DataFrame.from_records(stateResults) dfStateResults.to_csv(dst + '\\cdc_vaccine_states.csv') # upload files to Google Drive scope = [ "https://spreadsheets.google.com/feeds", 'https://www.googleapis.com/auth/spreadsheets', "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive" ] credentials = ServiceAccountCredentials.from_json_keyfile_name( 'client_secret.json', scope) client = gspread.authorize(credentials) for file in os.listdir(dst): spreadsheet = client.open(file[:-4]) with open(dst + '\\' + file, 'r') as file_obj: content = file_obj.read() client.import_csv(spreadsheet.id, data=content) ''' if __name__ == "__main__": '''