In [2]:
sheets = {
'f19_reviewer.csv':'1KJpIeML2f2t6UxxGFzOTOQPM0xtyUgJVVBrW3I9nyjU', # except change first Z to K
'f19_movie.csv'   :'1rrAUcQxNTGcwZTnUEI5kZJvDGjLE7V1LvB5Rey5rY1w', # except change first Z to r
'f19_rating.csv'  :'108q2iAlSiq8AQUJCOVa5uj8lkjIpBIPLIr83C41amYw'} # except change first Z to q

import requests
for sheet in sheets:
        url = 'https://docs.google.com/spreadsheets/d/' + sheets[sheet] + '/export?format=csv'
        r = requests.get(url)
        if r.status_code == 200: # success
            with open(sheet,'wb') as f:
                f.write(r.content)
            print('Downloaded '+sheet)
        else:
            print('Failed to get '+sheet)
Downloaded f19_reviewer.csv
Downloaded f19_movie.csv
Downloaded f19_rating.csv
In [13]:
import sqlite3

con = sqlite3.connect('f19_day15.sqlite')
cur = con.cursor()

q = 'select rid as WOW, firstname from reviewer limit 5'
cur.execute( q )

for row in cur.fetchall():
        print( row )
('777', 'John')
('102', 'Tong')
('3333', 'Chima')
('716', 'Ashok')
('515', 'Ji Ho')
In [14]:
[c[0] for c in cur.description]
Out[14]:
['WOW', 'firstname']
In [15]:
import pandas as pd
pd.DataFrame.from_records([[1,2,3],[4,5,7]],columns=['a','bb','vvv'])
#def frame(cur):
    
Out[15]:
a bb vvv
0 1 2 3
1 4 5 7

Actually, never mind that - there is a simpler way:

In [16]:
pd.read_sql_query(q,con)
Out[16]:
WOW firstname
0 777 John
1 102 Tong
2 3333 Chima
3 716 Ashok
4 515 Ji Ho
In [ ]: