Registry / http-networking / aiooss2

aiooss2

JSON →
library0.2.11pypypi✓ verified 84d ago

Async client for Alibaba Cloud OSS (Object Storage Service), built on oss2 and aiohttp/asyncio. Current version 0.2.11, released Mar 2024. Low release cadence (last release 0.2.11). Requires Python >=3.8.

pip install aiooss2
INSTALL
IMPORT
SIG · AIOOSS2
A
aiooss2
http-networkingpythonv0.2.11
Install
9.0s avg
Import
1444ms
Disk
62MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.11 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 1.496s · 61.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 9.0s · import 1.392s · 64MB
62MB installed
● package 62MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AioBucket
from aiooss2 import AioBucket
from aiooss2.bucket import AioBucket
AioBucket is exposed at top-level; do not import from submodule.
AioService
from aiooss2 import AioService
resumable_upload
from aiooss2 import resumable_upload
resumable_download
from aiooss2 import resumable_download

Basic usage: create Auth, AioBucket, list objects, upload file.

import asyncio from aiooss2 import AioBucket, AioService, Auth async def main(): auth = Auth(os.environ.get('OSS_ACCESS_KEY_ID', ''), os.environ.get('OSS_ACCESS_KEY_SECRET', '')) service = AioService(auth, 'https://oss-cn-hangzhou.aliyuncs.com') bucket = AioBucket(auth, 'my-bucket', 'oss-cn-hangzhou') # List objects async for obj in bucket.list_objects(): print(obj.key) # Upload file with open('local.txt', 'rb') as f: result = await bucket.put_object('remote.txt', f) await service.close() asyncio.run(main())
Debug
Known issues
gotchaAioBucket and AioService require an event loop to be running. Do not instantiate them before asyncio.run() or outside async context.
fix
Always create AioBucket/AioService inside a coroutine, typically after asyncio.run(main()).
affects: all
gotchaFor resumable_upload and resumable_download, the source argument must be a file path string, not a file-like object. Passing a file object silently fails.
fix
Use string path: await resumable_upload(bucket, 'remote_key', '/local/path')
affects: >=0.2.4
gotchaThe async methods on AioBucket return coroutines directly; no need to wrap in asyncio.ensure_future(). Failing to await them will raise RuntimeWarning.
fix
Always await: result = await bucket.put_object(...)
affects: all
deprecatedUsing positional arguments for endpoints is deprecated in favor of keyword arguments for clarity.
fix
Use AioBucket(auth, bucket_name, endpoint_name) with explicit keyword or positional as per current docs.
affects: >=0.2.0
Errors
Common errors & fixes
RuntimeError: Cannot close a running event loop
Calling await bucket.close() or service.close() inside a running event loop.
fix
Remove explicit close() or restructure to avoid closing inside loop; typically service is closed after all operations.
AttributeError: module 'aiooss2' has no attribute 'AioBucket'
Importing from aiooss2 before version 0.2.5 where top-level exports were added.
fix
Upgrade to >=0.2.5 or import from lower level: from aiooss2.bucket import AioBucket
oss2.exceptions.RequestError: ('Connection aborted.', ...)
Missing or incorrect endpoint; often wrong region or protocol mismatch.
fix
Ensure endpoint string includes 'https://' prefix, e.g., 'https://oss-cn-hangzhou.aliyuncs.com'.
Upgrade
Version history
0.2.11latest on PyPI · released Apr 14, 2024
Audit
Dependencies
oss2requiredCore dependency for OSS operations (sync counterpart).
aiohttprequiredAsync HTTP client.
Agent activity
62 hits · last 30 days
node
50
Perplexity
1
OpenAI (training)
1
Resources
aiooss2 — pip install aiooss2 · libregistry