:py:mod:`flow.record.adapter.text` ================================== .. py:module:: flow.record.adapter.text Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: flow.record.adapter.text.DefaultMissing flow.record.adapter.text.TextWriter Attributes ~~~~~~~~~~ .. autoapisummary:: flow.record.adapter.text.__usage__ flow.record.adapter.text.REPLACE_LIST .. py:data:: __usage__ :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Textual output adapter, similar to `repr()` (writer only) --- Write usage: rdump -w text://[PATH] [PATH]: path to file. Leave empty or "-" to output to stdout """ .. raw:: html
.. py:data:: REPLACE_LIST .. py:class:: DefaultMissing Bases: :py:obj:`dict` A dictionary subclass that returns a formatted string for missing keys. .. rubric:: Example >>> d = DefaultMissing({"foo": "bar"}) >>> d["foo"] 'bar' >>> d["missing_key"] '{missing_key}' .. py:method:: __missing__(key: str) -> str .. py:class:: TextWriter(path: str | pathlib.Path | BinaryIO, flush: bool = True, format_spec: str | None = None, **kwargs) Bases: :py:obj:`flow.record.adapter.AbstractWriter` Records are printed as textual representation with repr() or using `format_spec`. .. py:attribute:: fp :value: None .. py:attribute:: auto_flush :value: True .. py:attribute:: format_spec :value: None .. py:method:: write(rec: flow.record.base.Record) -> None Write a record. .. py:method:: flush() -> None Flush any buffered writes. .. py:method:: close() -> None Close the Writer, no more writes will be possible.