<jupyter_start><jupyter_text>InstructionAuthor: ChiehLet's start to take a look how to use MinIO server.Reference from official website. Register the MINIO serverPlease make sure that you have launched the server.<jupyter_code>from minio import Minio
import os 
minio_conf = {
    'endpoint': '0.0.0.0:9000',
    'access_key': 'minioadmin',
    'secret_key': 'minioadmin',
    'secure': False
}
minioClient = Minio(**minio_conf)

from minio.error import InvalidResponseError<jupyter_output><empty_output><jupyter_text>Check the bucket whether it exists or not?<jupyter_code>try:
    print(minioClient.bucket_exists("mybucket"))
except InvalidResponseError as err:
    print(err)<jupyter_output>False<jupyter_text>Create a bucket if it doest exist<jupyter_code>try:
    if minioClient.bucket_exists("mybucket"):
        print("Already created.")
    else:
        minioClient.make_bucket("mybucket", location="us-east-1")
        print("Created successfully.")
except InvalidResponseError as err:
    print(err)<jupyter_output>Created successfully.<jupyter_text>List all of buckets on the server<jupyter_code>buckets = minioClient.list_buckets()
for bucket in buckets:
    print(bucket.name, bucket.creation_date)<jupyter_output>mybucket 2022-03-24 03:03:48.051000+00:00<jupyter_text>Upload objects (files)<jupyter_code>file_name = 'person.jpg'

try:
    minioClient.fput_object("mybucket", file_name,file_name, 'application/jpg')
except InvalidResponseError as err:
    print(err)<jupyter_output><empty_output><jupyter_text>List the objects in the bucket<jupyter_code>objects = minioClient.list_objects('mybucket', prefix='my-prefixname',
                              recursive=True)
for obj in objects:
    print(obj.bucket_name, obj.object_name.encode('utf-8'), obj.last_modified,
          obj.etag, obj.size, obj.content_type)<jupyter_output><empty_output><jupyter_text>Download objects (files)<jupyter_code># Get a full object and prints the original object stat information.
location_path = 'test/person-server.jpg'
try:
    os.makedirs('test', exist_ok=True)
    minioClient.fget_object('mybucket', 'person.jpg', location_path)
    print(f"Download to {location_path}")
except InvalidResponseError as err:
    print(err)<jupyter_output>Download to test/person-server.jpg<jupyter_text>Remove objects (files)<jupyter_code># Remove an object.
try:
    minioClient.remove_object('mybucket', 'person.jpg')
except ResponseError as err:
    print(err)<jupyter_output><empty_output><jupyter_text>Remove the bucket<jupyter_code>try:
    if minioClient.bucket_exists("mybucket"):
        minioClient.remove_bucket("mybucket")
        print("Remove the bucket successfully.")
    else:
        print("There is no this bucket on the server.")
except ResponseError as err:
    print(err)<jupyter_output>Remove the bucket successfully.
{'fraction_non_alphanumeric': 0.1071049840933192, 'fraction_numerical': 0.012018381053375752, 'mean_word_length': 5.505747126436781, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '643841', 'license': 'Apache-2.0', 'n_tokens_mistral': 943, 'n_tokens_neox': 912, 'n_words': 196, 'path': 'minIO/Instruction.ipynb', 'repo_name': 'chiehpower/Installation', 'size': '2829'}