Asynchronous MinIO Python SDK
Project description
miniopy-async
Asynchronous MinIO Python SDK
Dependencies
- Python>3.6
Build from source
Github Repository
git clone https://github.com/hlf20010508/miniopy-async.git
cd miniopy-async
python setup.py install
Gitee Repository
git clone https://gitee.com/hlf01/miniopy-async.git
cd miniopy-async
python setup.py install
Install with pip
PyPI
pip install miniopy-async
Github Repository
pip install git+https://github.com/hlf20010508/miniopy-async.git
Gitee Repository
pip install git+https://gitee.com/hlf01/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
Gitee Repository
pipenv install git+https://gitee.com/hlf01/miniopy-async.git#egg=miniopy-async
Usage
import minio_async
Examples
from minio_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 minio_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 on Github and examples on Gitee
Refer documents in docs on Github and docs on Gitee
Link
- miniopy-async on PyPI
- miniopy-async on Github
- miniopy-async on Gitee
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.2.tar.gz
(60.3 kB
view details)
File details
Details for the file miniopy-async-1.2.tar.gz
.
File metadata
- Download URL: miniopy-async-1.2.tar.gz
- Upload date:
- Size: 60.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab983484456b50b26c478630aa0adac16eb7dd87d428f0e9fff2f618a56f7fb7 |
|
MD5 | 190aebffdadd758b5274816c1c508c75 |
|
BLAKE2b-256 | db3b5fa22c0717c110312ab523801e59f7369379c713b150b7baf1f5350eebf9 |