MCPcopy Create free account
hub / github.com/NanoNets/docstrange / can_process

Method can_process

docstrange/processors/html_processor.py:18–33  ·  view source on GitHub ↗

Check if this processor can handle the given file. Args: file_path: Path to the file to check Returns: True if this processor can handle the file

(self, file_path: str)

Source from the content-addressed store, hash-verified

16 """Processor for HTML files using markdownify for conversion."""
17
18 def can_process(self, file_path: str) -> bool:
19 """Check if this processor can handle the given file.
20
21 Args:
22 file_path: Path to the file to check
23
24 Returns:
25 True if this processor can handle the file
26 """
27 if not os.path.exists(file_path):
28 return False
29
30 # Check file extension - ensure file_path is a string
31 file_path_str = str(file_path)
32 _, ext = os.path.splitext(file_path_str.lower())
33 return ext in ['.html', '.htm']
34
35 def process(self, file_path: str) -> ConversionResult:
36 """Process the HTML file and return a conversion result.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected