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
- miniopy-async on PyPI
- miniopy-async on Github
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.7.tar.gz
(61.1 kB
view details)
Built Distribution
File details
Details for the file miniopy-async-1.7.tar.gz
.
File metadata
- Download URL: miniopy-async-1.7.tar.gz
- Upload date:
- Size: 61.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7146e0597bb28dc64eca0d885c2a0cdc5dc5c8c95a6f52cdaf89683e8496547 |
|
MD5 | 55b20e9524d90922b2dfa7f52d01b975 |
|
BLAKE2b-256 | f8d967ed479b8f911d0b0ad6a057e1851a7a043d23f66ef8060ae428c94868e4 |
File details
Details for the file miniopy_async-1.7-py3-none-any.whl
.
File metadata
- Download URL: miniopy_async-1.7-py3-none-any.whl
- Upload date:
- Size: 81.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e36585a52383c5fe75a3d612249229d1c866833287ca715b47812d39246f0b1 |
|
MD5 | 9ead004001bf12456cb5c5984fff30d8 |
|
BLAKE2b-256 | 699f71e10d5761496cf47f72ea4824151b3ae797e86ace241fb1d11f601c0744 |