pygsheets
pygsheets copied to clipboard
Google is deprecating the OOB Oauth2 workflow
See: https://developers.googleblog.com/2022/02/making-oauth-flows-safer.html#disallowed-oob
I believe this is the auth method used by pygsheets, so this will need to be changed to continue working into the future.
If you are just working locally then you should set local=True
in authorize
, the run_local_server
method is the replacement method. Now you will need to use the browser pop up to authorize pygsheets.
see https://github.com/nithinmurali/pygsheets/blob/staging/pygsheets/authorization.py#L45 for the internal code flow
This else
is deprecated
If you are working on a remote machine without browser access... I'm not sure what you should do but this thread seems to have some clues: https://github.com/r-lib/gargle/issues/202
Note for anyone having trouble with their migration from oob.
Once you changed your local credential, if you have the error deleted_client: The OAuth client was deleted.
Delete the local file named sheets.googleapis.com-python.json
Thanks for the pointers. After running an interactive auth flow using pygsheets.authorize(local=True)
the sheets.googleapis.com-python.json
was generated in the current working directory. That file can be used in subsequent (including headless) auth flows.
I believe Google has now deprecated the auth method that Pygsheet uses and now I believe that Pygsheets doesn't work.