Automate Google Sheets using Python

preview_player
Показать описание
iss video me hum janenge kaise #googlesheets ko #automate karenge using #python #hinditutorial
Рекомендации по теме
Комментарии
Автор

Thank you so much. I encountered several errors, but by using debugging techniques, I was able to identify and resolve the issues. Finally, I realized that the tutorial was missing a crucial step. None of the other tutorials I had watched mentioned enabling the Google Drive API, which was essential for my case.

muneebbolo
Автор

Thanks bro, it is really helpful.
It was difficult to implement this with other video tutorials.
But, your tutorial is right on point.

Thanks a lot!

shortly
Автор

Google sheets api update every 10 second update, ,some limitations or not

raviish
Автор

Nifty and Smallcap are at support levels. How should you approach this? I’ve created a detailed video explaining it

ads_sunrise
Автор

RefreshError Traceback (most recent call last)
Cell In[4], line 2
1 #werk=gc.open('Copy of SPM Casting Plan').Input
----> 2

File ~\AppData\Local\anaconda3\Lib\site-packages\gspread\client.py:189, in Client.open_by_key(self, key)
181 def open_by_key(self, key):
182 """Opens a spreadsheet specified by `key` (a.k.a Spreadsheet ID).
183
184 :param str key: A key of a spreadsheet as it appears in a URL in a browser.
(...)
187 >>>
188 """
--> 189 return Spreadsheet(self, {"id": key})

File ~\AppData\Local\anaconda3\Lib\site-packages\gspread\spreadsheet.py:34, in Spreadsheet.__init__(self, client, properties)
31 self.client = client
32 self._properties = properties
---> 34 metadata = self.fetch_sheet_metadata()
35

File ~\AppData\Local\anaconda3\Lib\site-packages\gspread\spreadsheet.py:243, in Spreadsheet.fetch_sheet_metadata(self, params)
239 params = {"includeGridData": "false"}
241 url = SPREADSHEET_URL % self.id
--> 243 r = self.client.request("get", url, params=params)
245 return r.json()

File ~\AppData\Local\anaconda3\Lib\site-packages\gspread\client.py:80, in Client.request(self, method, endpoint, params, data, json, files, headers)
70 def request(
71 self,
72 method,
(...)
78 headers=None,
79 ):
---> 80 response = getattr(self.session, method)(
81 endpoint,
82 json=json,
83 params=params,
84 data=data,
85 files=files,
86 headers=headers,
87 timeout=self.timeout,
88 )
90 if response.ok:
91 return response

File ~\AppData\Local\anaconda3\Lib\site-packages\requests\sessions.py:602, in Session.get(self, url, **kwargs)
594 r"""Sends a GET request. Returns :class:`Response` object.
595
596 :param url: URL for the new :class:`Request` object.
597 :param \*\*kwargs: Optional arguments that ``request`` takes.
598 :rtype: requests.Response
599 """
601 kwargs.setdefault("allow_redirects", True)
--> 602 return self.request("GET", url, **kwargs)

File ~\AppData\Local\anaconda3\Lib\site-packages\google\auth\transport\requests.py:545, in AuthorizedSession.request(self, method, url, data, headers, max_allowed_time, timeout, **kwargs)
542 remaining_time = max_allowed_time
544 with TimeoutGuard(remaining_time) as guard:
--> 545 self.credentials.before_request(auth_request, method, url, request_headers)
546 remaining_time = guard.remaining_timeout
548 with TimeoutGuard(remaining_time) as guard:

File ~\AppData\Local\anaconda3\Lib\site-packages\google\auth\credentials.py:156, in Credentials.before_request(self, request, method, url, headers)
152 # pylint: disable=unused-argument
153 # (Subclasses may use these arguments to ascertain information about
154 # the http request.)
155 if not self.valid:
--> 156 self.refresh(request)
157 metrics.add_metric_header(headers,
158 self.apply(headers)

File ~\AppData\Local\anaconda3\Lib\site-packages\google\oauth2\service_account.py:438, in Credentials.refresh(self, request)
436 else:
437 assertion =
--> 438 access_token, expiry, _ = _client.jwt_grant(
439 request, self._token_uri, assertion
440 )
441 self.token = access_token
442 self.expiry = expiry

File ~\AppData\Local\anaconda3\Lib\site-packages\google\oauth2\_client.py:312, in jwt_grant(request, token_uri, assertion, can_retry)
288 """Implements the JWT Profile for OAuth 2.0 Authorization Grants.
289
290 For more details, see `rfc7523 section 4`_.
(...)
309 """
310 body = {"assertion": assertion, "grant_type": _JWT_GRANT_TYPE}
--> 312 response_data = _token_endpoint_request(
313 request,
314 token_uri,
315 body,
316 can_retry=can_retry,
317 headers={
318 metrics.API_CLIENT_HEADER:
319 },
320 )
322 try:
323 access_token =

File ~\AppData\Local\anaconda3\Lib\site-packages\google\oauth2\_client.py:283, in _token_endpoint_request(request, token_uri, body, access_token, use_json, can_retry, headers, **kwargs)
272 response_status_ok, response_data, retryable_error =
273 request,
274 token_uri,
(...)
280 **kwargs
281 )
282 if not response_status_ok:
--> 283 _handle_error_response(response_data, retryable_error)
284 return response_data

File ~\AppData\Local\anaconda3\Lib\site-packages\google\oauth2\_client.py:74, in _handle_error_response(response_data, retryable_error)
71 except (KeyError, ValueError):
72 error_details = json.dumps(response_data)
---> 74 raise exceptions.RefreshError(
75 error_details, response_data, retryable=retryable_error
76 )

RefreshError: ('invalid_grant: Invalid JWT: Token must be a short-lived token (60 minutes) and in a reasonable timeframe. Check your iat and exp values in the JWT claim.', {'error': 'invalid_grant', 'error_description': 'Invalid JWT: Token must be a short-lived token (60 minutes) and in a reasonable timeframe. Check your iat and exp values in the JWT claim.'})

SubrajeetNayak-ldch