Asynchronous MinIO Python SDK for Amazon S3 Compatible Cloud Storage
Project description
Asynchronous MinIO Python SDK for Amazon S3 Compatible Cloud Storage
This project has been forked from original MinIO Python SDK and functionalities have been replaces with asynchronous patterns
MinIO Python SDK is Simple Storage Service (aka S3) client to perform bucket and object operations to any Amazon S3 compatible object storage service.
Minimum Requirements
Python 3.6 or higher.
Download using pip
pip3 install minio-async
Download source
git clone https://github.com/HuseynMashadiyev/minio-async
cd minio-py
python setup.py install
Quick Start Example - File Uploader
This example program connects to an S3-compatible object storage server, make a bucket on that server, and upload a file to the bucket.
You need the following items to connect to an S3-compatible object storage server:
Parameters | Description |
---|---|
Endpoint | URL to S3 service. |
Access Key | Access key (aka user ID) of an account in the S3 service. |
Secret Key | Secret key (aka password) of an account in the S3 service. |
This example uses MinIO server playground https://play.min.io. Feel free to use this service for test and development.
file_uploader.py
from minio import Minio
from minio.error import S3Error
def main():
# Create a client with the MinIO server playground, its access key
# and secret key.
client = Minio(
"play.min.io",
access_key="Q3AM3UQ867SPQQA43P2F",
secret_key="zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG",
)
# Make 'asiatrip' bucket if not exist.
found = await client.bucket_exists("asiatrip")
if not found:
await client.make_bucket("asiatrip")
else:
print("Bucket 'asiatrip' already exists")
# Upload '/home/user/Photos/asiaphotos.zip' as object name
# 'asiaphotos-2015.zip' to bucket 'asiatrip'.
await client.fput_object(
"asiatrip", "asiaphotos-2015.zip", "/home/user/Photos/asiaphotos.zip",
)
print(
"'/home/user/Photos/asiaphotos.zip' is successfully uploaded as "
"object 'asiaphotos-2015.zip' to bucket 'asiatrip'."
)
if __name__ == "__main__":
try:
main()
except S3Error as exc:
print("error occurred.", exc)
Run File Uploader
$ python file_uploader.py
'/home/user/Photos/asiaphotos.zip' is successfully uploaded as object 'asiaphotos-2015.zip' to bucket 'asiatrip'.
$ mc ls play/asiatrip/
[2016-06-02 18:10:29 PDT] 82KiB asiaphotos-2015.zip
More References
Explore Further
Contribute
Please refer Contributors Guide
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file minio-async-1.0.1.tar.gz
.
File metadata
- Download URL: minio-async-1.0.1.tar.gz
- Upload date:
- Size: 93.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68257ffa618b56b64b9a3c55d33a68ce58bd28ac78dd010d0499c1f8d7da57e3 |
|
MD5 | af931b162e996ab85f51682e8ab11610 |
|
BLAKE2b-256 | e8eb168206e8b1c45092d3b5ca583ebff97def9115ad7c9bdfe67a9d6bc3ee64 |
File details
Details for the file minio_async-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: minio_async-1.0.1-py3-none-any.whl
- Upload date:
- Size: 76.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5def2c74d1939ee432d3eebf34061b191730bd78441a5d8cd6e2c844c9f04b7 |
|
MD5 | b0a2727aea460818c689cfb17a56d62b |
|
BLAKE2b-256 | fa6e6fbb79dfb01ee9e2aef981c46c1511d8e58ca391ed52fa4700e0e5009d02 |