def download_object()

in src/s3_util.py [0:0]


    def download_object(self, remote_path, quite_mode=True):
        """
        Downloads binary bytes from s3 without saving file
        :param quite_mode: If False, prints the status of each file downloaded
        :param remote_path: The remote s3 path
        :return: returns binary bytes from s3 without saving file
        """
        start = datetime.datetime.now()

        bucket, key = self._get_bucketname_key(remote_path)

        s3 = boto3.client('s3')

        s3_response_object = s3.get_object(Bucket=bucket, Key=key)
        object_content = s3_response_object['Body'].read()

        if not quite_mode:
            download_time = datetime.datetime.now() - start

            print("Downloaded object {} in {} seconds ".format(remote_path, download_time.total_seconds()))

        return object_content