flytekit.core.data_persistence.DataPersistence

class flytekit.core.data_persistence.DataPersistence(name, default_prefix=None, **kwargs)[source]

Base abstract type for all DataPersistence operations. This can be extended using the flytekitplugins architecture

Methods

Parameters
  • name (str) –

  • default_prefix (Optional[str]) –

abstract 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

abstract exists(path)[source]

Returns true if the given path exists, else false

Parameters

path (str) –

Return type

bool

abstract 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)[source]

Returns true if the given path exists, else false

Parameters
  • path (str) –

  • recursive (bool) –

Return type

Generator[str, None, None]

abstract 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

default_prefix
name