Registry / aws / miniopy-async

miniopy-async

JSON →
library1.23.5pypypi✓ verified 85d ago

miniopy-async provides an asynchronous interface to the MinIO object storage server, building upon the official synchronous `minio` Python client by integrating `aiohttp`. It aims to stay up-to-date with `minio-py`'s features while providing `asyncio` compatibility. The current version is 1.23.5, and it maintains a frequent release cadence, often aligning with updates to the underlying `minio-py` library or addressing async-specific bugs.

pip install miniopy-async
INSTALL
IMPORT
SIG · MINIOPY-ASYNC
M
miniopy-async
awspythonv1.23.5
Install
5.0s avg
Import
843ms
Disk
38MB
Pass rate
9/ 10
Env Coverage9 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.23.5 · 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
glibc
py 3.10
✓ —
✓ 6.15s
py 3.11
✓ —
✓ 4.8s
py 3.12
✓ —
✓ 3.95s
py 3.13
✓ —
✓ 4.25s
py 3.9
✕ build_error
✓ 6s
38MB installed
● package 38MB
Code
Verified usage

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

Minio
from miniopy_async import Minio
from minio import Minio
Using 'minio' directly will import the synchronous client, not the async wrapper.
S3Error
from miniopy_async import S3Error
from minio.error import S3Error
While 'minio.error.S3Error' exists, it's best to import from 'miniopy_async' for consistency.

This quickstart demonstrates how to initialize the `Minio` client, list existing buckets, and create a new bucket asynchronously. Ensure your MinIO server endpoint and credentials are provided via environment variables or directly in the code for execution.

import os import asyncio from miniopy_async import Minio, S3Error async def main(): endpoint = os.environ.get("MINIO_ENDPOINT", "localhost:9000") access_key = os.environ.get("MINIO_ACCESS_KEY", "minioadmin") secret_key = os.environ.get("MINIO_SECRET_KEY", "minioadmin") secure = os.environ.get("MINIO_SECURE", "false").lower() == "true" client = Minio( endpoint=endpoint, access_key=access_key, secret_key=secret_key, secure=secure ) try: # Example: List all buckets buckets = await client.list_buckets() print(f"Successfully connected to MinIO. Found {len(buckets)} buckets:") for bucket in buckets: print(f" - {bucket.name} (created at {bucket.creation_date})") # Example: Make a bucket if it doesn't exist test_bucket = "my-test-bucket" found = await client.bucket_exists(test_bucket) if not found: await client.make_bucket(test_bucket) print(f"Bucket '{test_bucket}' created successfully.") else: print(f"Bucket '{test_bucket}' already exists.") except S3Error as e: print(f"MinIO S3 Error: {e.code} - {e.message}") except Exception as e: print(f"An unexpected error occurred: {e}") if __name__ == "__main__": # Ensure MinIO_ENDPOINT, MINIO_ACCESS_KEY, MINIO_SECRET_KEY are set # or MinIO is running locally with default credentials (minioadmin:minioadmin) asyncio.run(main())
Debug
Known issues
breakingPython 3.8 and 3.9 are deprecated and no longer officially supported due to type hinting requirements.
fix
Upgrade your Python environment to version 3.10 or newer to ensure full compatibility and access to all features.
affects: >=1.21.3
gotchaAll `miniopy-async` methods are coroutines and *must* be `await`ed. Forgetting `await` will result in a `TypeError` or unexpected behavior.
fix
Always prefix calls to `miniopy_async.Minio` methods (e.g., `client.list_buckets()`, `client.put_object()`) with the `await` keyword within an `async` function.
affects: All
breakingThe `Minio` constructor gained a `server_url` parameter, intended to replace `change_host` for specifying the server endpoint for presigned URLs.
fix
If generating presigned URLs and needing to specify a different host, use the `server_url` parameter in the `Minio` constructor instead of deprecated methods.
affects: >=1.22.1
gotchaThe `content-length-range` format for policy conditions in presigned URLs changed from integers to strings.
fix
Ensure that `content-length-range` values are passed as strings, e.g., `['1', '10485760']`, rather than integers.
affects: >=1.23.5
Errors
Common errors & fixes
TypeError: object asyncio.coroutine can't be used in 'await' expression
Attempting to call an asynchronous `miniopy-async` method without the `await` keyword, or calling an async function in a synchronous context.
fix
Ensure all calls to `miniopy-async` methods are prefixed with `await` (e.g., `await client.list_buckets()`). Also, ensure your main execution flow uses `asyncio.run(your_async_main_function())`.
ConnectionRefusedError: [Errno 111] Connection refused
The MinIO server is either not running, not accessible from your environment, or the `endpoint` specified in `Minio` client initialization is incorrect (e.g., wrong host or port).
fix
Verify that your MinIO server is running and accessible. Double-check the `endpoint` (e.g., `localhost:9000`) used when creating the `Minio` client instance.
miniopy_async.S3Error: [{'Code': 'NoSuchBucket', 'Message': 'The specified bucket does not exist'}]
An operation was attempted on a MinIO bucket that does not exist, or the bucket name provided has a typo.
fix
Check the bucket name for accuracy. If you intend to create the bucket, ensure your credentials have the necessary permissions and call `client.make_bucket()` first.
Upgrade
Version history
1.23.5latest on PyPI · released Mar 31, 2026
Audit
Dependencies
aiohttprequiredProvides the asynchronous HTTP client necessary for async operations.
miniorequiredThe core synchronous MinIO client which `miniopy-async` wraps for async functionality.
Agent activity
17 hits · last 30 days
node
14
Resources
miniopy-async — pip install miniopy-async · libregistry