S3Downloader: S3Downloader

S3DownloaderR Documentation

S3Downloader

Description

Contains static methods for downloading directories or files from S3.

Methods

Public methods


Method download()

Static method that downloads a given S3 uri to the local machine.

Usage
S3Downloader$download(
  s3_uri,
  local_path,
  kms_key = NULL,
  sagemaker_session = NULL
)
Arguments
s3_uri

(str): An S3 uri to download from.

local_path

(str): A local path to download the file(s) to.

kms_key

(str): The KMS key to use to decrypt the files.

sagemaker_session

(sagemaker.session.Session): Session object which manages interactions with Amazon SageMaker APIs and any other AWS services needed. If not specified, the estimator creates one using the default AWS configuration chain.


Method read_file()

Static method that returns the contents of an s3 uri file body as a string.

Usage
S3Downloader$read_file(s3_uri, sagemaker_session = NULL)
Arguments
s3_uri

(str): An S3 uri that refers to a single file.

sagemaker_session

(sagemaker.session.Session): AWS session to use. Automatically generates one if not provided.

Returns

str: The body of the file.


Method list()

Static method that lists the contents of an S3 uri.

Usage
S3Downloader$list(s3_uri, sagemaker_session = NULL)
Arguments
s3_uri

(str): The S3 base uri to list objects in.

sagemaker_session

(sagemaker.session.Session): AWS session to use. Automatically generates one if not provided.

Returns

[str]: The list of S3 URIs in the given S3 base uri.


Method format()

format class

Usage
S3Downloader$format()

Method clone()

The objects of this class are cloneable with this method.

Usage
S3Downloader$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


DyfanJones/sagemaker-r-local documentation built on June 14, 2022, 10:32 p.m.