flow.record.adapter.text¶
Module Contents¶
Classes¶
A dictionary subclass that returns a formatted string for missing keys. |
|
Records are printed as textual representation with repr() or using format_spec. |
Attributes¶
- flow.record.adapter.text.__usage__ = Multiline-String¶
Show Value
""" 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 """
- flow.record.adapter.text.REPLACE_LIST¶
- class flow.record.adapter.text.DefaultMissing¶
Bases:
dictA dictionary subclass that returns a formatted string for missing keys.
Example
>>> d = DefaultMissing({"foo": "bar"}) >>> d["foo"] 'bar' >>> d["missing_key"] '{missing_key}'
- __missing__(key: str) str¶
- class flow.record.adapter.text.TextWriter(path: str | pathlib.Path | BinaryIO, flush: bool = True, format_spec: str | None = None, **kwargs)¶
Bases:
flow.record.adapter.AbstractWriterRecords are printed as textual representation with repr() or using format_spec.
- fp = None¶
- auto_flush = True¶
- format_spec = None¶
- write(rec: flow.record.base.Record) None¶
Write a record.
- flush() None¶
Flush any buffered writes.
- close() None¶
Close the Writer, no more writes will be possible.