Convert extracted raw data. This method will return underlying data of extracted XML content. The data either has a `read` attribute (e.g. a file object or a StringIO/BytesIO) or is a string or bytes that is an XML document.
(
data: str | bytes | io.StringIO | io.BytesIO,
)
| 703 | |
| 704 | |
| 705 | def preprocess_data( |
| 706 | data: str | bytes | io.StringIO | io.BytesIO, |
| 707 | ) -> io.StringIO | io.BytesIO: |
| 708 | """ |
| 709 | Convert extracted raw data. |
| 710 | |
| 711 | This method will return underlying data of extracted XML content. |
| 712 | The data either has a `read` attribute (e.g. a file object or a |
| 713 | StringIO/BytesIO) or is a string or bytes that is an XML document. |
| 714 | """ |
| 715 | |
| 716 | if isinstance(data, str): |
| 717 | data = io.StringIO(data) |
| 718 | |
| 719 | elif isinstance(data, bytes): |
| 720 | data = io.BytesIO(data) |
| 721 | |
| 722 | return data |
| 723 | |
| 724 | |
| 725 | def _data_to_frame(data: list[dict[str, str | None]], **kwargs) -> DataFrame: |
no outgoing calls
no test coverage detected