Skip to main content

aiohttp wrapper for google-api-client-python

Project description


An aiohttp-based Google API client.

The google-api-python-client requirement is because this library uses it to discover services and prepare requests, leveraging the prepare+execute pattern implemented in googleapiclient.HttpRequest.



import asyncio
import aiohttp
from gaggle import Client

async def main():
    async with aiohttp.ClientSession() as session:
        drive = Client(
            # the following are optional and only required if the access_token is expired and can be refreshed
        resp = await drive.files.list(q="parents in 'root'")
        # resp is an instance of aiohttp.ClientResponse
        if resp.status == 200:
            data = await resp.json()
            files = data.get('files', [])
            for obj in files:

if __name__ == "__main__":
    loop = asyncio.get_event_loop()

Results in something like:

{'kind': 'drive#file', 'id': '...', 'name': 'test.csv', 'mimeType': 'text/csv'}
{'kind': 'drive#file', 'id': '...', 'name': 'Test Folder', 'mimeType': 'application/'}
{'kind': 'drive#file', 'id': '...', 'name': 'spreadsheet.xlsx', 'mimeType': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'}
{'kind': 'drive#file', 'id': '...', 'name': 'spreadsheet', 'mimeType': 'application/'}


$ pip install gaggle

Testing and developing

I've included a handy Makefile to make these things fairly easy.

$ make setup
$ make test

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for gaggle, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size gaggle-0.2.1-py3-none-any.whl (7.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size gaggle-0.2.1.tar.gz (4.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page