MCPcopy Create free account
hub / github.com/Topdu/OpenOCR / save_to_markdown

Method save_to_markdown

openocr.py:277–286  ·  view source on GitHub ↗

Save doc task results to Markdown (only for doc task). Supports both single result dict and list of results (from PDF).

(self, result, output_path: str)

Source from the content-addressed store, hash-verified

275 return self.model.save_to_json(result, output_path)
276
277 def save_to_markdown(self, result, output_path: str):
278 """Save doc task results to Markdown (only for doc task).
279 Supports both single result dict and list of results (from PDF)."""
280 if self.task != 'doc':
281 raise RuntimeError("save_to_markdown is only available for 'doc' task")
282 if isinstance(result, list):
283 for page_result in result:
284 self.model.save_to_markdown(page_result, output_path)
285 else:
286 return self.model.save_to_markdown(result, output_path)
287
288 def save_visualization(self, result, output_path: str):
289 """Save doc task visualization (only for doc task).

Callers 3

mainFunction · 0.95
test_python_apiMethod · 0.95
process_imageFunction · 0.45

Calls

no outgoing calls

Tested by 1

test_python_apiMethod · 0.76