Giter VIP home page Giter VIP logo

Comments (7)

lavigne958 avatar lavigne958 commented on June 10, 2024 2

True that! I will update the gspread client. So you can keep the same code and keep it working.

from gspread.

Natim avatar Natim commented on June 10, 2024
In [4]: gspread_service.set_timeout(300)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[4], line 1
----> 1 gspread_service.set_timeout(300)

AttributeError: 'Client' object has no attribute 'set_timeout'

In [5]: gspread_service
Out[5]: <gspread.client.Client at 0x7fe652783290>

from gspread.

Natim avatar Natim commented on June 10, 2024

In [6]: dir(gspread_service)
Out[6]: 
['__class__',
 '__delattr__',
 '__dict__',
 '__dir__',
 '__doc__',
 '__eq__',
 '__format__',
 '__ge__',
 '__getattribute__',
 '__getstate__',
 '__gt__',
 '__hash__',
 '__init__',
 '__init_subclass__',
 '__le__',
 '__lt__',
 '__module__',
 '__ne__',
 '__new__',
 '__reduce__',
 '__reduce_ex__',
 '__repr__',
 '__setattr__',
 '__sizeof__',
 '__str__',
 '__subclasshook__',
 '__weakref__',
 '_list_spreadsheet_files',
 'copy',
 'create',
 'del_spreadsheet',
 'export',
 'get_file_drive_metadata',
 'http_client',
 'import_csv',
 'insert_permission',
 'list_permissions',
 'list_spreadsheet_files',
 'open',
 'open_by_key',
 'open_by_url',
 'openall',
 'remove_permission']

from gspread.

Natim avatar Natim commented on June 10, 2024

I believe we should use gspread_service.http_client now

from gspread.

Natim avatar Natim commented on June 10, 2024

https://docs.gspread.org/en/v6.0.0/api/http_client.html

from gspread.

lrhazi avatar lrhazi commented on June 10, 2024

So how does one go from

        import gspread
        gspread_service = gspread.service_account(GSHEET_SERVICE_ACCOUNT_PATH)
        gspread_service.set_timeout(120)

to using http_client.html ?

and that document says this is not meant for the users to use!

from gspread.

Natim avatar Natim commented on June 10, 2024

So how does one go from

        import gspread
        gspread_service = gspread.service_account(GSHEET_SERVICE_ACCOUNT_PATH)
        gspread_service.set_timeout(120)

to using http_client.html ?

and that document says this is not meant for the users to use!

I personally did it like that:

import gspread
gspread_service = gspread.service_account(GSHEET_SERVICE_ACCOUNT_PATH)
gspread_service.http_client.set_timeout(120)

from gspread.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.