Accessing MinIO S3 using Boto3

Describes how to use Boto3 to interact wtih MinIO from a Jupyter Notebook.

You can use Boto3 to interact with Minio S3 services. Boto3 is a Python library that enables you to create, configure, and manage S3 services from a Jupyter Notebook.

The following example shows you how to run Boto3 in a Jupyter Notebook to list the existing Minio S3 buckets:
import boto3
import os

access_key_id = os.environ["AUTH_TOKEN"]
secret_access_key = "xxx"

LOCAL_S3_PROXY_SERVICE_URL = 'http://local-s3-service.ezdata-system.svc.cluster.local:30000'

s3 = boto3.client('s3',
aws_access_key_id=access_key_id,
aws_secret_access_key=secret_access_key,
endpoint_url=LOCAL_S3_PROXY_SERVICE_URL
)

s3.list_buckets()
NOTE
If your token has expired, run the following magic command to refresh your tokens.
%update_token