Я новичок в кодировании на python, а также в кодировании в целом. Я делаю проект, который берет информацию из листов Google и отображает ее в терминале. Кажется, он не работает, но, как новичок (это мой первый проект), я понятия не имею, что делать. Я использовал Google API для получения учетных данных. Вот код, который я написал:
import gspread
from oauth2client.service_account import ServiceAccountCredentials
scope = ['https://spreadsheets.google.com/feeds']
creds = ServiceAccountCredentials.from_json_keyfile_name('sheetsproject-765dzxv233334.json',scope)
client = gspread.authorize(creds)
sheet = client.open('python test').sheet1
options = sheet.get_all_records()
print(options)
это результат в терминале:
Traceback (most recent call last):
File "/Users/jordanmaggin/Desktop/python/sheets.py", line 9, in <module>
sheet = client.open('python test').sheet1 File "/Users/jordan/opt/anaconda3/lib/python3.7/site-packages/gspread/client.py", line 123, in open
self.list_spreadsheet_files()
File "/Users/jordanmaggin/opt/anaconda3/lib/python3.7/site-packages/gspread/client.py", line 96, in list_spreadsheet_files
res = self.request('get', url, params=params).json()
File "/Users/jordan/opt/anaconda3/lib/python3.7/site-packages/gspread/client.py", line 79, in request
raise APIError(response) gspread.exceptions.APIError: {'errors': [{'domain': 'global', 'reason': 'insufficientPermissions', 'message': 'Insufficient Permission: Request had insufficient authentication scopes.'}], 'code': 403, 'message': 'Insufficient Permission: Request had insufficient authentication scopes.'}
вот учебник, который я использую: учебник