Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hlf20010508/miniopy-async
Asynchronous MinIO Client SDK for Python
https://github.com/hlf20010508/miniopy-async
aiohttp async bucket minio minio-async miniopy-async python sanic
Last synced: about 5 hours ago
JSON representation
Asynchronous MinIO Client SDK for Python
- Host: GitHub
- URL: https://github.com/hlf20010508/miniopy-async
- Owner: hlf20010508
- License: apache-2.0
- Created: 2022-07-03T02:05:12.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-30T15:33:44.000Z (3 months ago)
- Last Synced: 2024-11-09T12:49:51.691Z (10 days ago)
- Topics: aiohttp, async, bucket, minio, minio-async, miniopy-async, python, sanic
- Language: Python
- Homepage:
- Size: 2.94 MB
- Stars: 65
- Watchers: 3
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# miniopy-async
> Asynchronous MinIO Client SDK for Python[![PyPI](https://img.shields.io/pypi/v/miniopy-async)](https://pypi.org/project/miniopy-async/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/miniopy-async)](https://pypi.org/project/miniopy-async/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/miniopy-async)](https://pypi.org/project/miniopy-async/)
[![GitHub repo size](https://img.shields.io/github/repo-size/hlf20010508/miniopy-async)](https://github.com/hlf20010508/miniopy-async)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/hlf20010508/miniopy-async/python-publish.yml)](https://github.com/hlf20010508/miniopy-async/actions)
[![GitHub closed issues](https://img.shields.io/github/issues-closed/hlf20010508/miniopy-async)](https://github.com/hlf20010508/miniopy-async/issues?q=is%3Aissue+is%3Aclosed)
[![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/hlf20010508/miniopy-async)](https://github.com/hlf20010508/miniopy-async/pulls?q=is%3Apr+is%3Aclosed)## Catalogue
- [Declaration](#declaration)
- [Minimum Requirements](#requirements)
- [Build from source](#build)
- [Installation](#installation)
- [Quick Start](#example)
- [More References](#references)
## Declaration
- This project is based on Huseyn Mashadiyev's [minio-async](https://github.com/HuseynMashadiyev/minio-async/tree/78128443f7ce9618191e1155689b47507df67bb1) 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
```sh
git clone https://github.com/hlf20010508/miniopy-async.git
cd miniopy-async
python setup.py install
```
## Installation
### Install with pip
PyPI
```sh
pip install miniopy-async
```Github Repository
```sh
pip install git+https://github.com/hlf20010508/miniopy-async.git
```### Install with pipenv
PyPI
```sh
pipenv install miniopy-async
```Github Repository
```sh
pipenv install "miniopy-async@ git+https://github.com/hlf20010508/miniopy-async.git"
```
## Quick Start
```py
from miniopy_async import Minio
import asyncioclient = 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()
``````py
from sanic import Sanic, response
from miniopy_async import Minio
from urllib import parseapp = 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
- Python Client API Reference
- Examples