nannyml.io.file_writer module

class nannyml.io.file_writer.FileWriter(path: str, write_args: Dict[str, Any] | None = None, credentials: Dict[str, Any] | None = None, fs_args: Dict[str, Any] | None = None)[source]

Bases: Writer, ABC

An abstract Writer implementation that writes results out to a filesystem (either local or remote / cloud).

This abstract base class provides a helper _write_bytes_to_filesystem function that helps to implement the abstract _write function.

Creates a new FileWriter

Parameters:
  • path (str) – The path to read data from. Can be a regular file path or contain a protocol.

  • write_args (Dict[str, Any]) – Specific arguments passed along the method performing the actual writing.

  • credentials (Dict[str, Any]) – Used to provide credential information following specific fsspec implementations.

  • fs_args – Specific arguments passed along to the fsspec filesystem initializer.