(pdf_path: str)
| 2683 | |
| 2684 | def _parse_pdf_for_report(pdf_path: str) -> Dict[str, Any]: |
| 2685 | pdf_parser = _load_pdf_parser() |
| 2686 | text = pdf_parser.extract_text_from_pdf(pdf_path) |
| 2687 | metadata = pdf_parser.extract_metadata(text) |
| 2688 | sections = pdf_parser.extract_sections(text) |
| 2689 | return { |
| 2690 | **metadata, |
| 2691 | "sections": sections, |
| 2692 | "full_text": text, |
| 2693 | } |
| 2694 | |
| 2695 | |
| 2696 | def _mineru_enabled() -> bool: |
| 2697 | return _env_flag("MINERU_PARSE_ENABLED", default=True) and bool(os.environ.get("MINERU_API_KEY", "").strip()) |
no test coverage detected