OiO.lk Blog python Loading gsheet data into Python with gspread
python

Loading gsheet data into Python with gspread


This is an example from their docs:

import gspread

credentials = {
    "type": "service_account",
    "project_id": "api-project-XXX",
    "private_key_id": "2cd … ba4",
    "private_key": "-----BEGIN PRIVATE KEY-----\nNrDyLw … jINQh/9\n-----END PRIVATE KEY-----\n",
    "client_email": "473000000000-yoursisdifferent@developer.gserviceaccount.com",
    "client_id": "473 … hd.apps.googleusercontent.com",
    ...
}

gc = gspread.service_account_from_dict(credentials)

sh = gc.open("Example spreadsheet")

print(sh.sheet1.get('A1'))

but what exactly goes in their "Example spreadsheet"?

When I copy paste the entire link from my browser, it says Spreadsheet not found. If I copy just the gid, I get the same output. If I copy the middle part, I still get the same error 🙁



You need to sign in to view this answers

Exit mobile version