{"library":"miniopy-async","title":"Asynchronous MinIO Client SDK","description":"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.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install miniopy-async"],"cli":null},"imports":["from miniopy_async import Minio","from miniopy_async import S3Error"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nimport asyncio\nfrom miniopy_async import Minio, S3Error\n\nasync def main():\n    endpoint = os.environ.get(\"MINIO_ENDPOINT\", \"localhost:9000\")\n    access_key = os.environ.get(\"MINIO_ACCESS_KEY\", \"minioadmin\")\n    secret_key = os.environ.get(\"MINIO_SECRET_KEY\", \"minioadmin\")\n    secure = os.environ.get(\"MINIO_SECURE\", \"false\").lower() == \"true\"\n\n    client = Minio(\n        endpoint=endpoint,\n        access_key=access_key,\n        secret_key=secret_key,\n        secure=secure\n    )\n\n    try:\n        # Example: List all buckets\n        buckets = await client.list_buckets()\n        print(f\"Successfully connected to MinIO. Found {len(buckets)} buckets:\")\n        for bucket in buckets:\n            print(f\"  - {bucket.name} (created at {bucket.creation_date})\")\n\n        # Example: Make a bucket if it doesn't exist\n        test_bucket = \"my-test-bucket\"\n        found = await client.bucket_exists(test_bucket)\n        if not found:\n            await client.make_bucket(test_bucket)\n            print(f\"Bucket '{test_bucket}' created successfully.\")\n        else:\n            print(f\"Bucket '{test_bucket}' already exists.\")\n\n    except S3Error as e:\n        print(f\"MinIO S3 Error: {e.code} - {e.message}\")\n    except Exception as e:\n        print(f\"An unexpected error occurred: {e}\")\n\nif __name__ == \"__main__\":\n    # Ensure MinIO_ENDPOINT, MINIO_ACCESS_KEY, MINIO_SECRET_KEY are set\n    # or MinIO is running locally with default credentials (minioadmin:minioadmin)\n    asyncio.run(main())\n","lang":"python","description":"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}