Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Download and run process of MinIO Python SDK

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article will explain in detail about the MinIO Python SDK download and operation process, the article content is of high quality, so Xiaobian share for everyone to make a reference, I hope you have a certain understanding of related knowledge after reading this article.

MinIO Python SDK is a Simple Storage Service (aka S3) client for performing bucket and object operations on any Amazon S3 compatible object storage service.

minimum requirements

Python 3.6 or later.

download using pip pip3 install minio download source git clone https://github.com/minio/minio-pycd minio-python setup.py install Quick Start Example-File Uploader

This sample program connects to an S3-compatible object storage server, creates a bucket on the server, and uploads files to the bucket.

You need the following to connect to an S3-compatible object storage server:

Parameter Description Describes the URL of the endpoint S3 service. Access Key S3 The access key (also known as the user ID) for the account in the service. Secret Key S3 The secret key (also known as password) of the account in the service.

This example uses the MinIO test site [https://play.min.io](https://play.min.io). Feel free to use this service for testing and development.

file_uploader.py# Import MinIO library.from minio import Miniofrom minio.error import (ResponseError, BucketAlreadyOwnedByYou, BucketAlreadyExists)# Initialize minioClient with an endpoint and access/secret keys.minioClient = Minio('play.min.io', access_key='Q3AM3UQ867SPQQA43P2F', secret_key='zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG', secure=True)# Make a bucket with the make_bucket API call.try: minioClient.make_bucket("maylogs", location="us-east-1")except BucketAlreadyOwnedByYou as err: passexcept BucketAlreadyExists as err: passexcept ResponseError as err: raise# Put an object 'pumaserver_debug.log' with contents from 'pumaserver_debug.log'.try: minioClient.fput_object('maylogs', 'pumaserver_debug.log', '/tmp/pumaserver_debug.log')except ResponseError as err: print(err) Run File Uploader $ python file_uploader.py'/home/user/Photos/asiaphotos.zip' is successfully uploaded as object 'asiaphotos-2015.zip' to bucket 'asiatrip'.$ mc ls play/asiatrip/[2016-06-02 18:10:29 PDT] 82KiB asiaphotos-2015.zip About MinIO Python SDK download and running process to share here, I hope the above content can be of some help to you, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report