Python - MinIO

The MinIO Python Client SDK provides high level APIs to access any MinIO Object Storage or other Amazon S3 compatible service.

Introduction

is an S3-compatible object storage.

The official Python SDK, minio-py, lets you create and manage buckets, upload/download objects, list and remove objects and generate presigned URLs from any Amazon S3 compatible service, including MinIO.

Play

The play server is a public MinIO cluster at https://play.min.io. It runs the latest stable MinIO and is ideal for testing.

Note

Credentials are public; anything you upload is world-readable. Don’t use it for private data.

To connect to the target service, create a MinIO client using the Minio() method with the following required parameters:

ParameterDescription
endpointURL of the target service.
access_keyAccess key (user ID) of a user account in the service.
secret_keySecret key (password) for the user account.

For example:

from minio import Minio
client = Minio(
endpoint="play.min.io",
access_key="Q3AM3UQ867SPQQA43P2F",
secret_key="zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG",
)

Examples

Filebase

The Client SDK is compatible with Dades - Filebase.

Task

Create a client configuring it to use filebase credentials and endpoint.

Create a bucket named my-bucket.

Upload a file named my-file.txt with the content Hello, MinIO!.

Retrieve the file and print its content.

Task

Configure continuous integration to run tests on each push.

You must set config variables in Gitlab for the CI pipeline to work.

Go to Settings > CI/CD > Variables and add the following variables: ACCESS_KEY and SECRET_KEY.

Pending