miniopy-async
Asynchronous MinIO Client SDK for Python
- Document: https://hlf20010508.github.io/miniopy-async/
- Examples: https://github.com/hlf20010508/miniopy-async/tree/master/examples
Build from Source
git clone https://github.com/hlf20010508/miniopy-async.git
cd miniopy-async
poetry install
poetry build
Installation
PyPI
pip install miniopy-async
Github Repository
pip install git+https://github.com/hlf20010508/miniopy-async.git
Quick Start
from miniopy_async import Minio
import asyncio
async def main():
async with Minio(
"play.min.io",
access_key="Q3AM3UQ867SPQQA43P2F",
secret_key="zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG",
secure=True, # http for False, https for True
) as client:
url = await client.presigned_get_object("my-bucket", "my-object")
print("url:", url)
asyncio.run(main())
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)
@app.after_server_stop
async def close_minio_client(*_):
await client.close_session()
Metadata
Release files for miniopy-async 1.23.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| miniopy_async-1.23.5.tar.gz | 80.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| miniopy_async-1.23.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 181.6 kB
Release files / miniopy_async-1.23.5.tar.gz
| Download URL | miniopy_async-1.23.5.tar.gz |
|---|---|
| Size | 80.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
33a559b3b63f82e34ac48e2b3e999edae7da3640788996a2633287cb4100d7f1
|
|
BLAKE2b-256 checksum How to use checksums |
f9a5d8d26e63a36f43e0fcacc26998ea3c80f57c927c4fb52f2d68d0eedc6bee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.10.16 Linux/6.17.0-1008-azure
|
Release files / miniopy_async-1.23.5-py3-none-any.whl
| Download URL | miniopy_async-1.23.5-py3-none-any.whl |
|---|---|
| Size | 100.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9f27944eb16b3e29fd9440466192e73a14c30f370d53ccb1843c517b480e8467
|
|
BLAKE2b-256 checksum How to use checksums |
6c8f317a93e6647777c28bac5a8241cc8fbf0f7c93dea2b2b78b59d005a098c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.10.16 Linux/6.17.0-1008-azure
|