Asynchronous MinIO Python Client API
- 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.
- Python>3.6
git clone -b miniopy-async https://github.com/hlf20010508/miniopy-async.git
cd minio-async
python setup.py install
PyPI
pip install miniopy-async
Github Repository
pip install git+https://github.com/hlf20010508/miniopy-async.git
PyPI
pipenv install miniopy-async
Github Repository
pipenv install git+https://github.com/hlf20010508/miniopy-async.git#egg=miniopy-async
import miniopy_async
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
- miniopy-async on PyPI
- miniopy-async on Github