Skip to content

Commit

Permalink
Update minio_utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
knitemblazor authored Aug 5, 2021
1 parent 1dc1040 commit 1bb7cab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion minio_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from minio import Minio
import os

#connecting to minio and downloading files from bucket
#filepath includes the file path with bucket as root

class MinioConnect:
def __init__(self, minio_link, access_key, secret_key):
Expand All @@ -12,4 +14,4 @@ def __init__(self, minio_link, access_key, secret_key):
def download(self,bucket_name, file_path, temp_path_to_save):
response = self.client.get_object(bucket_name, file_path)
file = open(os.path.join(temp_path_to_save,file_path.split("/")[-1]), "wb")
file.write(response.data)
file.write(response.data)

0 comments on commit 1bb7cab

Please sign in to comment.