(self, file_path: str)
| 562 | ) |
| 563 | |
| 564 | def parse_zip(self, file_path: str) -> List[dict]: |
| 565 | extract_dir = os.path.join(self.data_root, f"zip_{hash_sha256(file_path)}") |
| 566 | os.makedirs(extract_dir, exist_ok=True) |
| 567 | |
| 568 | results = [] |
| 569 | for extracted_file in parse_zip(file_path, extract_dir): |
| 570 | if (ft := get_file_type(extracted_file)) in self.parsers: |
| 571 | try: |
| 572 | results.extend(self.parsers[ft](extracted_file)) |
| 573 | except Exception as e: |
| 574 | logger.warning(f"Skip files {extracted_file}: {str(e)}") |
| 575 | |
| 576 | if not results: |
| 577 | raise ValueError("No parseable content found in the ZIP file") |
| 578 | return results |
nothing calls this directly
no test coverage detected