I'm writing a program for a friend to help with writing note cards and it working fine until I hit a strange error:

gspread.exceptions.APIError: {
  "error": {
    "code": 429,
    "message": "Quota exceeded for quota group 'ReadGroup' and limit 'USER-100s' of service 'sheets.googleapis.com' for consumer 'project_number:74842143740'.",
    "status": "RESOURCE_EXHAUSTED",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.Help",
        "links": [
          {
            "description": "Google developer console API key",
            "url": "https://console.developers.google.com/project/PROJECT#/apiui/credential"
          }
        ]
      }
    ]
  }
}

I was very confused as this hadn't been a problem and I couldn't see why it should be

my code:

import gspread
from oauth2client.service_account import ServiceAccountCredentials

scope = ["https://spreadsheets.google.com/feeds","https://www.googleapis.com/auth/drive"]
creds = ServiceAccountCredentials.from_json_keyfile_name('client_secret.json', scope)
client = gspread.authorize(creds)

sheet = client.open('Note Card BS').sheet1

for i in range(2, 22):
  while sheet.cell(2, i).value=="":
    source = input("What is source "+str(i-1)+"?: ")
    sheet.update_cell(2, i, source)
  for j in range(3, 18):
    while sheet.cell(j, i).value=="":
      fact = input("Fact "+str(j-2)+" from source no."+str(i-1)+": ")
      sheet.update_cell(j, i, fact)
  if sheet.cell(2, i+1).value =="":
    while True:
      add = input("Would you like to add another fact from source "+str(i-1)+"?(y/n): ")
      if add=="y":
        factNo = len(sheet.col_values(i))
        fact = input("Fact "+str(factNo-3)+" from source no."+str(i-1)+": ")
        sheet.update_cell(factNo+1, i, fact)
        sheet.update_cell(factNo, 1, factNo-3)
      else:
        break

It doesn't seem to me like it ought to be calling it that often so I don't know what's going on. My friend was working on his stuff and all of a sudden it was all red(I put it on repl.it) and he thought he had broken something. he needs this soon so any help would be very much appreciated.

0 Answers