Asynchronous MinIO Client SDK for Python
Project description
miniopy-async
Asynchronous MinIO Client SDK for Python
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
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
miniopy_async-1.21.0.tar.gz
(64.8 kB
view details)
Built Distribution
File details
Details for the file miniopy_async-1.21.0.tar.gz
.
File metadata
- Download URL: miniopy_async-1.21.0.tar.gz
- Upload date:
- Size: 64.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9fad40ed3b8c4f4f75bb8eaa8ac7908536ebce50736c93390488c59a01a192a |
|
MD5 | 46db86e9b9373fc3f8a5735dd822eee0 |
|
BLAKE2b-256 | 897399ec956a6c22b40ebe8e2264f536849bf417a883e8dea17b3b23e1f376ad |
File details
Details for the file miniopy_async-1.21.0-py3-none-any.whl
.
File metadata
- Download URL: miniopy_async-1.21.0-py3-none-any.whl
- Upload date:
- Size: 84.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2965ace0b0b0d0d6f9358bc8450ca36cb432117fe6f53c263d6f468bb29da36c |
|
MD5 | bea27158ad9fd1c317e2b6ed2a534cab |
|
BLAKE2b-256 | 0ecbcd65f6b52db70ba540c708236009659d6ef01a53a6d46c421775d2ef41ce |