Skip to main content

Asynchronous MinIO Python Client API

Project description

miniopy-async

Asynchronous MinIO Python Client API

Declaration

This project is based on Huseyn Mashadiyev's minio-async 1.0.0


Dependencies

  • Python>3.6

Build from source

git clone -b miniopy-async https://github.com/hlf20010508/minio-async.git
cd minio-async
python setup.py install

Install with pip

PyPI

pip install miniopy-async

Github Repository

pip install git+https://github.com/hlf20010508/minio-async.git@miniopy-async

Install with pipenv

PyPI

pipenv install miniopy-async

Github Repository

pipenv install git+https://github.com/hlf20010508/minio-async.git@miniopy-async#egg=minio-async

Usage

import minio_async

Examples

from minio_async import Minio
import asyncio

client = Minio(
    "play.min.io",
    access_key="Q3AM3UQ867SPQQA43P2F",
    secret_key="zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG",
    secure=True  # http for False, https for True
)

async def main():
    url = await client.presigned_get_object("my-bucket", "my-object")
    print('url:', url)

loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()
from sanic import Sanic
from minio_async import Minio

app = Sanic(__name__)

client = Minio(
    "play.min.io",
    access_key="Q3AM3UQ867SPQQA43P2F",
    secret_key="zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG",
    secure=True  # http for False, https for True
)

@app.route('/download', methods=['GET'])
async def download(request):
    print('downloading ...')
    bucket=request.form.get('bucket')
    fileName=request.form.get('fileName')

    # decodeURI, for those which has other language in fileName, such as Chinese, Japanese, Korean
    fileName = parse.unquote(fileName)

    url = await client.presigned_get_object(bucket_name=bucket, object_name=fileName)
    return redirect(url)

Check more examples in examples

Refer documents in docs


Link

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

miniopy-async-1.4.tar.gz (60.8 kB view details)

Uploaded Source

File details

Details for the file miniopy-async-1.4.tar.gz.

File metadata

  • Download URL: miniopy-async-1.4.tar.gz
  • Upload date:
  • Size: 60.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.10

File hashes

Hashes for miniopy-async-1.4.tar.gz
Algorithm Hash digest
SHA256 f5490bde94d4a43539ef53f653ae3e84781c9354d1850ef36737dcff506a2725
MD5 6d2e168a985b8f9a21cd1e2695785be7
BLAKE2b-256 4cd212a066c229c333c6d9a4e8f6c4603c3616096a765640a803b84398daeb8f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page