Skip to main content

Asynchronous MinIO Client SDK for Python

Project description

miniopy-async

Asynchronous MinIO Client SDK for Python

PyPI PyPI - Downloads PyPI - Python Version
GitHub repo size GitHub Workflow Status GitHub closed issues GitHub closed pull requests

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 features.
  • Miniopy-async 1.2 has been pulled requests to minio-async.

Minimum Requirements

  • Python>3.6

Build from source

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

Installation

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 "miniopy-async@ git+https://github.com/hlf20010508/miniopy-async.git"

Quick Start

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, response
from miniopy_async import Minio
from urllib import parse

app = Sanic(__name__)

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


# http://127.0.0.1:8000/download?bucket=my-bucket&fileName=testfile
@app.route('/download', methods=['GET'])
async def download(request):
    print('downloading ...')
    bucket=request.args.get('bucket')
    fileName=request.args.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 response.redirect(url)

More References

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.18.tar.gz (64.3 kB view details)

Uploaded Source

Built Distribution

miniopy_async-1.18-py3-none-any.whl (83.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for miniopy-async-1.18.tar.gz
Algorithm Hash digest
SHA256 cae2a4bede1b3663b41db66932887cc2325baa70dd327744c484ac50a791b17c
MD5 693ed3a989daa4d484a4f04f369a61e5
BLAKE2b-256 01cc9a2a65f1926af8521ab602be68cb8501ed3c2a5de728961acd9806a0b239

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for miniopy_async-1.18-py3-none-any.whl
Algorithm Hash digest
SHA256 f943abf45ebd1e5c34587361a1a05e11a5e92e89698e2d0c659d2016085c7122
MD5 596d1ac260d0f3504ce4011da8cec341
BLAKE2b-256 cce75bcb279c5afbc7f42974528e15fb76116237f6de69a6402e4dff6d50bd28

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