FileWriter#
- class FileWriter(file: IO)[source]#
-
Base class for format writers.
Every writer needs a writable stream. The JSONL, CSV, and Avro writers write at the stream’s current position.
JsonFileWriterrewrites its whole file on each write.- Variables:
mode (str) – Mode
FilePublisheruses to open this writer’s file.newline (str | None) –
newlineargumentFilePublisheruses to open this writer’s file.
Wrap an open stream.
- Parameters:
file (IO[AnyStr])
Stream that receives the records. Text or binary, per the format.
- Raises:
ValueError – If the stream is not writable.
Attributes
Methods
Write one Measurement or Command to the stream.
- abstractmethod write(
- data: Measurement | Command,
Write one Measurement or Command to the stream.