Search documentation
karat

+

K

User Documentation ↗

transforms.api.FoundryDataSidecarFileSystem

class transforms.api.FoundryDataSidecarFileSystem(param, read_only=False, read_mode='current')

A file system for reading and writing raw dataset files in lightweight, single-node transforms.

Returns FoundryDataSidecarFile objects for reading and writing files in the dataset.

ls(glob=None, regex='.*', show_hidden=False)

Recurses through all directories and lists all files matching the given patterns, starting from the root directory of the dataset.

  • Parameters:
    • glob (str , optional) – A unix file-matching pattern. Also supports globstar.
    • regex (str , optional) – A regex pattern against which to match filenames.
    • show_hidden (bool , optional) – Include hidden files, those prefixed with ‘.’ or ‘_’.
  • Yields: FileStatus – The logical path, file size, and modified timestamp.

open(path, mode='r', **kwargs)

Open a FoundryFS file in the given mode.

Should be used in a with statement, especially when writing to a file.

  • Parameters:
    • path (str) – The logical path of the file in the dataset.
    • mode (str) – The file opening mode, defaults to read.
    • **kwargs – Remaining keyword args passed to io.open().
  • Returns: a Python file-like object attached to the stream.
  • Return type: File