nannyml.io.pickle_file_writer module

class nannyml.io.pickle_file_writer.PickleFileWriter(path: str, credentials: Optional[Dict[str, Any]] = None, fs_args: Optional[Dict[str, Any]] = None, write_args: Optional[Dict[str, Any]] = None)[source]

Bases: FileWriter

Writes Results to disk (local/remote/cloud) as a pickle file.

A FileWriter implementation that pickles a Result object and writes the resulting bytestream to local or cloud storage.

Parameters:
  • path (str) – The directory in which to output the generated pickle file. The name of the pickle file will equal the fully qualified result class name with a pkl extension, e.g. nannyml.drift.univariate.result.pkl

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

  • fs_args (default=None) – Specific arguments passed along to the fsspec filesystem initializer.

Examples

>>> writer = PickleFileWriter(
...    path='s3://my-output-bucket/output',
...    credentials={'aws_access_key_id': 'access_key_id', 'aws_secret_access_key': 'secret_access_key'}
... )
>>> writer.write(result)