March 26, 2020 Python Q&A

Topics covered in this session include:

  • Review of the Google authentication process
  • Writing Google sheets using df2gspread
  • Example of FinViz web scan data pushed into Google sheets


# -*- coding: utf-8 -*-
Created on Thu Mar 12 07:45:26 2020

@author: Bruce1

#  This did not work, RunTime Error with Spyder IDE
#from finviz.screener import Screener

#filters = ['ind_copper', 'sec_basicmaterials']  # Shows companies in NASDAQ which are in the S&P500
# Get the first 50 results sorted by price ascending
#stock_list = Screener(filters=filters, order='price')

import pandas as pd

from df2gspread import df2gspread as d2g
from df2gspread import gspread2df as g2d

url = ',sec_basicmaterials'

df = pd.read_html(url, header=0)[14]


spreadsheet = '/new_folder/My_FinViz_Test'
wks_name = 'MAW1x'

d2g.upload(df, spreadsheet, wks_name)