Extract raw XML data. The method accepts two input types: 1. filepath (string-like) 2. file-like object (e.g. open file object, StringIO)
(
filepath_or_buffer: FilePath | ReadBuffer[bytes] | ReadBuffer[str],
encoding: str | None,
compression: CompressionOptions,
storage_options: StorageOptions,
)
| 675 | |
| 676 | |
| 677 | def get_data_from_filepath( |
| 678 | filepath_or_buffer: FilePath | ReadBuffer[bytes] | ReadBuffer[str], |
| 679 | encoding: str | None, |
| 680 | compression: CompressionOptions, |
| 681 | storage_options: StorageOptions, |
| 682 | ): |
| 683 | """ |
| 684 | Extract raw XML data. |
| 685 | |
| 686 | The method accepts two input types: |
| 687 | 1. filepath (string-like) |
| 688 | 2. file-like object (e.g. open file object, StringIO) |
| 689 | """ |
| 690 | filepath_or_buffer = stringify_path(filepath_or_buffer) |
| 691 | with get_handle( |
| 692 | filepath_or_buffer, |
| 693 | "r", |
| 694 | encoding=encoding, |
| 695 | compression=compression, |
| 696 | storage_options=storage_options, |
| 697 | ) as handle_obj: |
| 698 | return ( |
| 699 | preprocess_data(handle_obj.handle.read()) |
| 700 | if hasattr(handle_obj.handle, "read") |
| 701 | else handle_obj.handle |
| 702 | ) |
| 703 | |
| 704 | |
| 705 | def preprocess_data( |
no test coverage detected