flytekit.extras.persistence.S3Persistence

class flytekit.extras.persistence.S3Persistence(default_prefix=None)[source]

DataPersistence plugin for AWS S3 (and Minio). Use aws cli to manage the transfer. The binary needs to be installed separately

pip install awscli

Methods

Parameters

default_prefix (Optional[str]) –

construct_path(add_protocol, add_prefix, *paths)[source]

if add_protocol is true then <protocol> is prefixed else Constructs a path in the format <base><delim>*args delim is dependent on the storage medium. each of the args is joined with the delim

Parameters
  • add_protocol (bool) –

  • add_prefix (bool) –

  • paths (str) –

Return type

str

exists(remote_path)[source]

Given a remote path of the format s3://, checks if the remote file exists

get(from_path, to_path, recursive=False)[source]

Retrieves data from from_path and writes to the given to_path (to_path is locally accessible)

Parameters
  • from_path (str) –

  • to_path (str) –

  • recursive (bool) –

listdir(path, recursive=False)

Returns true if the given path exists, else false

Parameters
  • path (str) –

  • recursive (bool) –

Return type

Generator[str, None, None]

put(from_path, to_path, recursive=False)[source]

Stores data from from_path and writes to the given to_path (from_path is locally accessible)

Parameters
  • from_path (str) –

  • to_path (str) –

  • recursive (bool) –

Attributes

PROTOCOL = 's3://'
default_prefix
name