Args: source (str|bytes): The source, which could be a path, a URL or a bytes object.
(self, source: str | bytes, config: ParsingConfig)
| 183 | raise ValueError(f"Unsupported document type: {source_name}") |
| 184 | |
| 185 | def __init__(self, source: str | bytes, config: ParsingConfig): |
| 186 | """ |
| 187 | Args: |
| 188 | source (str|bytes): The source, which could be |
| 189 | a path, a URL or a bytes object. |
| 190 | """ |
| 191 | super().__init__(config) |
| 192 | self.config = config |
| 193 | if isinstance(source, bytes): |
| 194 | self.source = "bytes" |
| 195 | self.doc_bytes = BytesIO(source) |
| 196 | else: |
| 197 | self.source = source |
| 198 | self.doc_bytes = self._load_doc_as_bytesio() |
| 199 | |
| 200 | @staticmethod |
| 201 | def _document_type( |
nothing calls this directly
no test coverage detected