databay.outlets.file_outlet

class databay.outlets.file_outlet.FileOutlet(default_filepath: str, default_file_mode: str = 'a', default_encoding: str = 'utf-8', *args, **kwargs)[source]

databay.outlets.file_outlet.FileOutlet

Outlet that writes records to a file.

Parameters
  • default_filepath (str) – Filepath of the default file to write records to.

  • default_file_mode (str) – Default write mode to use when writing into the file.

  • default_encoding (str) – Default file encoding when writing into a file.

    Default:
    utf-8

Bases: databay.outlet.Outlet

push(self, records: [Record], update)[source]

Writes records to a file.

Parameters
  • records (list[Record]) – List of records generated by inlets. Each top-level element of this array corresponds to one inlet that successfully returned data. Note that inlets could return arrays too, making this a nested array.

  • update (Update) – Update object representing the particular Link transfer.