trading_agent.attachments.plain_text_reader
¶
Reads files that already are text: plain text, Markdown, CSV, TSV and JSON.
Typical usage example:
extracted = PlainTextReader().read(Path('trades.csv'))
PlainTextReader
¶
Bases: TextReader
Reads a text file as it is.
read
¶
Reads the file, replacing bytes that are not UTF-8.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
The file. |
required |
Returns:
| Type | Description |
|---|---|
ExtractedText
|
Its text. |
Raises:
| Type | Description |
|---|---|
TextReadError
|
The file cannot be opened. |