in credit-card-fraud-detection/neptune_ml_utils.py [0:0]
def __upload_to_s3(self, bucketname: str):
path = urlparse(bucketname, allow_fragments=False)
bucket = path.netloc
file_path = path.path.lstrip('/').rstrip('/')
s3_client = boto3.client('s3')
for root, dirs, files in os.walk(self.formatted_directory):
for file in files:
s3_client.upload_file(os.path.join(
self.formatted_directory, file), bucket, f'{file_path}/{file}')