pythonでgoogleスプレッドシートを扱うには
GCPとスプレッドシードの共有をしておく必要があるのでまだの方はこちらから先に作業をおこなってください。
gspreadを使います
import gspread
import json
from oauth2client.service_account import ServiceAccountCredentials
scope = ['https://spreadsheets.google.com/feeds','https://www.googleapis.com/auth/drive']
credentials = ServiceAccountCredentials.from_json_keyfile_name('kaz-spread-ed768c1249d2.json', scope)
#OAuth2を使ってgoogleAPIにログインします。
gc = gspread.authorize(credentials)
#スプレッドシートキーはurlのd/と/editの間の文字列
SPREADSHEET_KEY = '1DIksumD9T2gCO3UJeVAjfIb_2Vze4FRn2-z5PLyJAzw'
#スプレッドシートのシート1を開く
worksheet = gc.open_by_key(SPREADSHEET_KEY).worksheet("シート1")
#A1のセルの値を受け取る
import_value = worksheet.acell('B1').value
print(import_value)
=> import_valueの値が表示されます