I am trying to play with google Sheets using python but it is giving me the error. It may be due to not having optimizing code logic.
Error
gspread.exceptions.APIError: {'code': 429, 'message': "Quota exceeded for quota metric 'Write requests' and limit 'Write requests per minute per user' of service 'sheets.googleapis.com' for .", 'status': 'RESOURCE_EXHAUSTED', 'details': [{'@type': 'type.googleapis.com/google.rpc.ErrorInfo', 'reason': 'RATE_LIMIT_EXCEEDED', 'domain': 'googleapis.com', 'metadata': {'quota_limit': 'WriteRequestsPerMinutePerUser',, 'quota_metric': 'sheets.googleapis.com/write_requests', 'service': 'sheets.googleapis.com'}}]}
shop_names = ['wilmermobel', 'masonheron', 'flashree', 'jochiwon', 'senangku', 'dutchgaming', 'hiranai', 'chairsy', 'genelotrics', 'bahemas', 'gameniture', 'martenkaiser', 'secretracer']
web_data_non_ful = ['0', '5.13', '0', '0', '0.00', '0.00', '0', '0', '6.25', '0.58', '0', '0', '0.00']
web_data_late_ship = ['0', '8.89', '0', '0', '8.33', '0.00', '0', '0', '0', '1.51', '0', '0', '0.00']
web_data_pre_time = ['0', '1.50', '2.02', '1.49', '2.17', '0.93', '2.04', '0.94', '1.30', '1.77', '', '', '1.07']
web_data_resp_rate = ['57.00', '96.01', '95.45', '100.00', '98.26', '98.32', '92.97', '91.05', '98.70', '97.44', '100.00', '57.00', '97.04']
web_data_shop_rate = ['0', '4.85', '5.00', '5.00', '4.70', '4.78', '4.89', '4.74', '4.88', '4.74', '5.00', '0', '4.71']
web_data_penal_points = ['0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0']
def sheet_updater('sheet1', col_num, col_data):
for cn, cd in zip(col_num, col_data):
try:
r = 2
x = 0
for i in range(13):
try:
time.sleep(1)
t = sheet.update_cell(r, cn, cd[x])
print(t)
r += 1
except:
pass
x += 1
except:pass
col_data = [shop_names, web_data_non_ful, web_data_late_ship,web_data_pre_time, web_data_resp_rate, web_data_shop_rate, web_data_penal_points]
col_num = [1, 2, 3, 4, 5, 6, 7]
sheet_updater('sheet1', col_num, col_data)