gspread icon indicating copy to clipboard operation
gspread copied to clipboard

Asyncio support

Open iAnanich opened this issue 7 years ago • 5 comments

I'm using gspread as driver for storage for items from scrapy spiders. And there is many items from one job, so gspread takes a long time to write them all.

I think, that it can work faster if making requests in async. Can it be so?

iAnanich avatar Jun 18 '17 20:06 iAnanich

You can provide your own [http session object] (https://gspread.readthedocs.io/en/latest/#gspread.Client) when initializing a gspread client, so in theory you can implement something wrapping e.g aiohttp so you execute your HTTP request async.

I don't know if this would have any advantage over just creating multiple gspread client instances though.

seppestas avatar Sep 07 '17 15:09 seppestas

I've written an asyncio API for gspread that wraps the gspread client and adds a few more high-level features. If adding an async API is on the table for gspread I would be willing to open a PR if @burnash will give feedback on what needs to be done to get it merged, otherwise I can release it as its own package.

dgilman avatar Jun 25 '18 02:06 dgilman

My gspread_asyncio library is now available on PyPI.

dgilman avatar Oct 23 '18 12:10 dgilman

@dgilman Thanks for writing this!

battogtokhb avatar Aug 23 '20 07:08 battogtokhb

Hi @dgilman thank you very much for you work, I'll look into it, that might be something of interest for sure ! thanks again.

lavigne958 avatar May 07 '21 19:05 lavigne958