gspread
gspread copied to clipboard
Asyncio support
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?
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.
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.
My gspread_asyncio library is now available on PyPI.
@dgilman Thanks for writing this!
Hi @dgilman thank you very much for you work, I'll look into it, that might be something of interest for sure ! thanks again.