Skip to content

Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.

work review

Sidney233c05e77fcdd52
diff --git a/mineru/model/docx/docx_converter.py b/mineru/model/docx/docx_converter.py
index 8a6a029d..b369d0a7 100644
--- a/mineru/model/docx/docx_converter.py
+++ b/mineru/model/docx/docx_converter.py
@@ -24,11 +24,6 @@ from mineru.utils.docx_fomatting import Formatting, Script
from mineru.utils.enum_class import BlockType, ContentType
from mineru.utils.pdf_reader import image_to_b64str
-ACCEPTED_MIME_TYPE_PREFIXES = [
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
-]
-
-
class DocxConverter:
_BLIP_NAMESPACES: Final = {
"a": "http://schemas.openxmlformats.org/drawingml/2006/main",
diff --git a/mineru/model/pptx/__init__.py b/mineru/model/pptx/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/mineru/model/pptx/pptx_converter.py b/mineru/model/pptx/pptx_converter.py
new file mode 100644
index 00000000..56ae638c
--- /dev/null
+++ b/mineru/model/pptx/pptx_converter.py
@@ -0,0 +1,32 @@
+from typing import Final, BinaryIO
+
+from pptx import Presentation, presentation
+
+
+class PptxConverter:
+ _BLIP_NAMESPACES: Final = {
+ "a": "http://schemas.openxmlformats.org/drawingml/2006/main",
+ "c": "http://schemas.openxmlformats.org/drawingml/2006/chart",
+ "p": "http://schemas.openxmlformats.org/presentationml/2006/main",
+ }
+
+ def __init__(self):
+ self.file_stream = None
+ self.pptx_obj = None
+
+ def convert(
+ self,
+ file_stream: BinaryIO,
+ ):
+ self.file_stream = file_stream
+ self.pptx_obj = Presentation(self.file_stream)
+ if self.pptx_obj:
+ self._walk_linear(self.pptx_obj)
+
+ def _walk_linear(self, pptx_obj: presentation.Presentation):
+ slide_width = pptx_obj.slide_width
+ slide_height = pptx_obj.slide_height
+
+ # 遍历每一张幻灯片
+ for _, slide in enumerate(pptx_obj.slides):
+ pass
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 4bbda444..89e5d6fb 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -42,6 +42,7 @@ dependencies = [
"mineru-vl-utils>=0.1.19.1,<1",
"qwen-vl-utils>=0.0.14,<1",
"python-docx>=1.2.0,<2",
+ 'python-pptx>=1.0.2,<2',
"mammoth>=1.11.0,<2",
"pylatexenc>=2.10,<3",
"lxml>=4.0.0,<7.0.0",