Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
AsyncioGspreadClientManager
✓ from gspread_asyncio import AsyncioGspreadClientManager
✗ from gspread import AsyncioGspreadClientManager
gspread itself does not have async classes
AsyncioGspreadClient
✓ from gspread_asyncio import AsyncioGspreadClient
Not directly needed typically, use manager to get client
AsyncioGspreadSpreadsheet
✓ from gspread_asyncio import AsyncioGspreadSpreadsheet
AsyncioGspreadWorksheet
✓ from gspread_asyncio import AsyncioGspreadWorksheet
Authorize and read a cell value from a Google Sheet asynchronously.
import asyncio
from gspread_asyncio import AsyncioGspreadClientManager
def get_creds():
# Replace with your own credentials
return None
async def main():
agcm = AsyncioGspreadClientManager(get_creds)
agc = await agcm.authorize()
ss = await agc.open_by_key('your_spreadsheet_key')
ws = await ss.get_worksheet(0)
val = await ws.acell('A1')
print(val.value)
asyncio.run(main())
Errors
Common errors & fixes
TypeError: AsyncioGspreadWorksheet.update() takes 2 positional arguments but 3 were given
In v2.0.0, update() changed from (range_name, values) to (values, range_name).
fixCall ws.update(values, range_name) or use keyword arguments: ws.update(values=[...], range_name='...')
AttributeError: module 'gspread_asyncio' has no attribute 'AsyncioGspreadClient'
Importing incorrectly, e.g., `from gspread_asyncio import AsyncioGspreadClient` but the class is named AsyncioGspreadClient or similar variant.
fixCheck the actual class name: `from gspread_asyncio import AsyncioGspreadClientManager` and then use `.authorize()` to get a client.
RuntimeError: Task <Task pending ...> got Future <Future pending ...> attached to a different loop
Mixing asyncio event loops, often due to creating the event loop after calling asyncio.run() or using multiple threads.
fixEnsure all async code runs on the same event loop; prefer asyncio.run() over manual loop handling.
Upgrade
Version history
2.0.0latest on PyPI · released Feb 10, 2024
Audit
Dependencies
gspreadrequiredCore dependency for Google Sheets interaction
oauth2clientoptionalUsed for authentication in examples
google-auth-oauthliboptionalAlternative modern authentication