Skip to main content

A async aliyun OSS library.

Project description

Based on

文档参考官方文档, 调用io操作的接口前加await即可

result = await bucket.get_object(...


body = await

Getting started

# -*- coding: utf-8 -*-

import aiooss

endpoint = '' # Suppose that your bucket is in the Hangzhou region.

auth = aiooss.Auth('<Your AccessKeyID>', '<Your AccessKeySecret>')

async def go(loop):
    # The object key in the bucket is story.txt
    async with aiooss.Bucket(auth, endpoint, '<your bucket name>') as bucket:
        key = 'story.txt'

        # Upload
        await bucket.put_object(key, 'Ali Baba is a happy youth.')

        # Upload
        data = dict(a=1, b=2)
        await bucket.put_object(key, json.dumps(data), headers={'Content-Type': 'application/json'})

        # Download
        result = await bucket.get_object(key)

        # Delete
        await bucket.delete_object(key)

        # Traverse all objects in the bucket
        async for object_info in aiooss.ObjectIterator(bucket):

loop = asyncio.get_event_loop()

Project details

Download files

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

Source Distribution

aiooss-0.1.2.tar.gz (16.3 kB view hashes)

Uploaded source

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