Skip to main content

Async client for aws services using botocore and aiohttp

Project description

Async client for amazon services using botocore and aiohttp/asyncio.

Main purpose of this library to support amazon s3 api, but other services should work (may be with minor fixes). For now we have tested only upload/download api for s3, other users report that SQS and Dynamo services work also. More tests coming soon.


$ pip install aiobotocore

Basic Example

import asyncio
import aiobotocore


async def go(loop):
    bucket = 'dataintake'
    filename = 'dummy.bin'
    folder = 'aiobotocore'
    key = '{}/{}'.format(folder, filename)

    session = aiobotocore.get_session(loop=loop)
    async with session.create_client('s3', region_name='us-west-2',
                                   aws_access_key_id=AWS_ACCESS_KEY_ID) as client:
        # upload object to amazon s3
        data = b'\x01'*1024
        resp = await client.put_object(Bucket=bucket,

        # getting s3 object properties of file we just uploaded
        resp = await client.get_object_acl(Bucket=bucket, Key=key)

        # delete object from s3
        resp = await client.delete_object(Bucket=bucket, Key=key)

        # list s3 objects using paginator
        paginator = client.get_paginator('list_objects')
        async for result in paginator.paginate(Bucket=bucket, Prefix=folder):
            for c in result.get('Contents', []):

        # get object from s3
        response = await client.get_object(Bucket=bucket, key=key)
        # this will ensure the connection is correctly re-used/closed
        async with response['Body'] as stream:
            bytes = await

loop = asyncio.get_event_loop()

Run Tests

Make sure you have development requirements installed and your amazon key and secret accessible via environment variables:

$ cd aiobotocore
$ export AWS_ACCESS_KEY_ID=xxx
$ pip install -Ur requirements-dev.txt

Execute tests suite:

$ py.test -v tests



0.2.3 (XXXX-XX-XX)

0.2.2 (2017-03-07)

  • set aiobotocore.__all__ for * imports #121 (thanks @graingert)
  • fix ETag in head_object response #132

0.2.1 (2017-02-01)

  • Normalize headers and handle redirection by botocore #115 (thanks @Fedorof)

0.2.0 (2017-01-30)

  • add support for proxies (thanks @jjonek)
  • remove AioConfig verify_ssl connector_arg as this is handled by the create_client verify param
  • remove AioConfig limit connector_arg as this is now handled by by the Config max_pool_connections property (note default is 10)

0.1.1 (2017-01-16)

  • botocore updated to version 1.5.0

0.1.0 (2017-01-12)

  • Pass timeout to aiohttp.request to enforce read_timeout #86 (thanks @vharitonsky) (bumped up to next semantic version due to read_timeout enabling change)

0.0.6 (2016-11-19)

  • Added enforcement of plain response #57 (thanks @rymir)
  • botocore updated to version 1.4.73 #74 (thanks @vas3k)

0.0.5 (2016-06-01)

  • Initial alpha release

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 aiobotocore-botorange, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size aiobotocore_botorange-0.1.0-py3-none-any.whl (17.3 kB) File type Wheel Python version 3.5 Upload date Hashes View
Filename, size aiobotocore-botorange-0.1.0.tar.gz (16.5 kB) File type Source Python version None Upload date Hashes View

Supported by

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