markitdown-pro 1.3.4__tar.gz → 1.3.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/PKG-INFO +1 -1
- markitdown_pro-1.3.6/markitdown_pro/common/schemas.py +17 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/conversion_pipeline.py +64 -65
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro.egg-info/PKG-INFO +1 -1
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/setup.py +1 -1
- markitdown_pro-1.3.4/markitdown_pro/common/schemas.py +0 -7
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/README.md +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/__init__.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/common/__init__.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/common/isolated_worker.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/common/logger.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/common/utils.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/converters/__init__.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/converters/azure_doc_intel_wrapper.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/converters/azure_speech_wrapper.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/converters/base.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/converters/gpt_vision_wrapper.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/converters/markitdown_wrapper.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/converters/pymupdf_wrapper.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/converters/tabular_wrapper.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/converters/unstructured_wrapper.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/converters/youtube_wrapper.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/handlers/__init__.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/handlers/audio_handler.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/handlers/base_handler.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/handlers/email_handler.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/handlers/epub_handler.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/handlers/image_handler.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/handlers/ipynb_handler.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/handlers/markitdown_handler.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/handlers/markup_handler.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/handlers/office_handler.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/handlers/pdf_handler.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/handlers/pst_handler.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/handlers/tabular_handler.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/handlers/text_handler.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/services/__init__.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/services/azure_doc_intelligence.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/services/azure_speech.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/services/openai_services.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro.egg-info/SOURCES.txt +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro.egg-info/dependency_links.txt +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro.egg-info/requires.txt +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro.egg-info/top_level.txt +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/pyproject.toml +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/setup.cfg +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/tests/conversion_pipeline/__init__.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/tests/conversion_pipeline/test_conversion_pipeline.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/tests/handlers/__init__.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/tests/handlers/test_email_handler.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/tests/handlers/test_epub_handler.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/tests/handlers/test_image_handler.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/tests/handlers/test_ipynb_handler.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/tests/handlers/test_markitdown_handler.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/tests/handlers/test_markup_handler.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/tests/handlers/test_pst_handler.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/tests/handlers/test_tabular_handler.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/tests/handlers/test_text_handler.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/tests/page_count/__init__.py +0 -0
- {markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/tests/page_count/test_pdf_page_count.py +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import enum
|
|
2
|
+
from io import BytesIO
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class NamedBytesIO(BytesIO):
|
|
6
|
+
def __init__(self, data: bytes, name: str):
|
|
7
|
+
super().__init__(data)
|
|
8
|
+
self.name = name
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ExtensionCategory(enum.Enum):
|
|
12
|
+
IMAGE = "image"
|
|
13
|
+
AUDIO = "audio"
|
|
14
|
+
VIDEO = "video"
|
|
15
|
+
LIGHTWEIGHT_TEXT = "lightweight_text"
|
|
16
|
+
FORMATTED_DOCS = "formatted_docs"
|
|
17
|
+
OTHER = "other"
|
|
@@ -38,6 +38,7 @@ from typing import Optional
|
|
|
38
38
|
import httpx
|
|
39
39
|
|
|
40
40
|
from .common.logger import logger
|
|
41
|
+
from .common.schemas import ExtensionCategory
|
|
41
42
|
from .common.utils import clean_markdown, detect_extension, ensure_minimum_content
|
|
42
43
|
from .converters.azure_doc_intel_wrapper import DocIntelligenceWrapper
|
|
43
44
|
from .handlers.audio_handler import AudioHandler
|
|
@@ -91,73 +92,70 @@ class ConversionPipeline:
|
|
|
91
92
|
self.markitdown_handler = MarkItDownHandler()
|
|
92
93
|
self.doc_intel_wrapper = DocIntelligenceWrapper()
|
|
93
94
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
# endregion
|
|
151
|
-
# region Others
|
|
152
|
-
".epub": self.epub_handler,
|
|
153
|
-
".eml": self.email_handler,
|
|
154
|
-
".p7s": self.email_handler,
|
|
155
|
-
".msg": self.email_handler,
|
|
156
|
-
".pst": self.pst_handler,
|
|
157
|
-
".ipynb": self.ipynb_handler,
|
|
158
|
-
# endregion
|
|
95
|
+
self.handlers_categories: dict[ExtensionCategory, dict[str, BaseHandler]] = {
|
|
96
|
+
ExtensionCategory.IMAGE: {
|
|
97
|
+
".bmp": self.image_handler,
|
|
98
|
+
".gif": self.image_handler,
|
|
99
|
+
# ".heic": self.image_handler,
|
|
100
|
+
".jpeg": self.image_handler,
|
|
101
|
+
".jpg": self.image_handler,
|
|
102
|
+
".png": self.image_handler,
|
|
103
|
+
# ".prn": self.image_handler,
|
|
104
|
+
".svg": self.image_handler,
|
|
105
|
+
".tiff": self.image_handler,
|
|
106
|
+
".webp": self.image_handler,
|
|
107
|
+
".heif": self.image_handler,
|
|
108
|
+
},
|
|
109
|
+
ExtensionCategory.AUDIO: {
|
|
110
|
+
".mp3": self.audio_handler,
|
|
111
|
+
".wav": self.audio_handler,
|
|
112
|
+
# ".ogg": self.audio_handler,
|
|
113
|
+
# ".flac": self.audio_handler,
|
|
114
|
+
# ".m4a": self.audio_handler,
|
|
115
|
+
# ".aac": self.audio_handler,
|
|
116
|
+
# ".wma": self.audio_handler,
|
|
117
|
+
# ".webm": self.audio_handler,
|
|
118
|
+
# ".opus": self.audio_handler,
|
|
119
|
+
},
|
|
120
|
+
ExtensionCategory.LIGHTWEIGHT_TEXT: {
|
|
121
|
+
".txt": self.text_handler,
|
|
122
|
+
".md": self.text_handler,
|
|
123
|
+
".py": self.text_handler,
|
|
124
|
+
".go": self.text_handler,
|
|
125
|
+
".csv": self.tabular_handler,
|
|
126
|
+
".tsv": self.tabular_handler,
|
|
127
|
+
".html": self.markup_handler,
|
|
128
|
+
".htm": self.markup_handler,
|
|
129
|
+
".xml": self.markup_handler,
|
|
130
|
+
".json": self.markup_handler,
|
|
131
|
+
".ndjson": self.markup_handler,
|
|
132
|
+
".yaml": self.markup_handler,
|
|
133
|
+
".yml": self.markup_handler,
|
|
134
|
+
".epub": self.epub_handler,
|
|
135
|
+
".eml": self.email_handler,
|
|
136
|
+
".p7s": self.email_handler,
|
|
137
|
+
".msg": self.email_handler,
|
|
138
|
+
".pst": self.pst_handler,
|
|
139
|
+
".ipynb": self.ipynb_handler,
|
|
140
|
+
},
|
|
141
|
+
ExtensionCategory.FORMATTED_DOCS: {
|
|
142
|
+
".pdf": self.pdf_handler,
|
|
143
|
+
".xls": self.tabular_handler,
|
|
144
|
+
".xlsx": self.tabular_handler,
|
|
145
|
+
".docx": self.office_handler,
|
|
146
|
+
# ".odt": self.office_handler,
|
|
147
|
+
# ".rtf": self.office_handler,
|
|
148
|
+
# ".ppt": self.office_handler,
|
|
149
|
+
".pptx": self.office_handler,
|
|
150
|
+
},
|
|
159
151
|
}
|
|
160
152
|
|
|
153
|
+
# Normalize map of extensions to handlers
|
|
154
|
+
self.handlers_mapping: dict[str, BaseHandler] = {}
|
|
155
|
+
for handlers in self.handlers_categories.values():
|
|
156
|
+
for ext, handler in handlers.items():
|
|
157
|
+
self.handlers_mapping[ext] = handler
|
|
158
|
+
|
|
161
159
|
# ---------------------------------------------------------------------
|
|
162
160
|
# Public APIs
|
|
163
161
|
# ---------------------------------------------------------------------
|
|
@@ -313,3 +311,4 @@ class ConversionPipeline:
|
|
|
313
311
|
else:
|
|
314
312
|
logger.warning(f"ConversionPipeline: No page count support for extension '{extension}'")
|
|
315
313
|
return None
|
|
314
|
+
return None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/converters/azure_doc_intel_wrapper.py
RENAMED
|
File without changes
|
{markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/converters/azure_speech_wrapper.py
RENAMED
|
File without changes
|
|
File without changes
|
{markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/converters/gpt_vision_wrapper.py
RENAMED
|
File without changes
|
{markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/converters/markitdown_wrapper.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/converters/unstructured_wrapper.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/markitdown_pro/services/azure_doc_intelligence.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{markitdown_pro-1.3.4 → markitdown_pro-1.3.6}/tests/conversion_pipeline/test_conversion_pipeline.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|