MCPcopy Create free account
hub / github.com/Alibaba-NLP/DeepResearch / parse_zip

Method parse_zip

inference/file_tools/file_parser.py:564–578  ·  view source on GitHub ↗
(self, file_path: str)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

hash_sha256Function · 0.90
get_file_typeFunction · 0.90
parse_zipFunction · 0.85
warningMethod · 0.80

Tested by

no test coverage detected