Skip to main content

Asynchronous MinIO Python Client API

Project description

miniopy-async

Asynchronous MinIO Python Client API


Catalogue


Declaration

  • This project is based on Huseyn Mashadiyev's minio-async 1.0.0.
  • This project has fixed some bugs of minio-async and added some new functions.
  • Miniopy-async 1.2 has been pulled request to minio-async.

Dependencies

  • Python>3.6

Build from source

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

Install

Install with pip

PyPI

pip install miniopy-async

Github Repository

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

Install with pipenv

PyPI

pipenv install miniopy-async

Github Repository

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

Usage

import miniopy_async

Examples

from miniopy_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 miniopy_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.8.tar.gz (62.4 kB view details)

Uploaded Source

Built Distribution

miniopy_async-1.8-py3-none-any.whl (81.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for miniopy-async-1.8.tar.gz
Algorithm Hash digest
SHA256 323d9da6fa2689bf7b227bfe47aa03e97d062cab7c3b44e05cf6f1a3c96afd1b
MD5 c2dbf573c66527072f56e193280df66b
BLAKE2b-256 c5512415ed0270c714d0cf4e691d68d8fe8403c91c2ed7b0dae46b7c7881da25

See more details on using hashes here.

File details

Details for the file miniopy_async-1.8-py3-none-any.whl.

File metadata

  • Download URL: miniopy_async-1.8-py3-none-any.whl
  • Upload date:
  • Size: 81.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for miniopy_async-1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 d19c6bae67126063c47bcf7f0afaaf40dbfdc05fba6c514664dc59cb67bd5bd7
MD5 cc36cc5872879fb636a2e90c71888152
BLAKE2b-256 0cfe05e046109c5a424abbeedb86fab4077a30f0403d71c39f7fbec7cf90f166

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