markitdown-gc 0.3.3__tar.gz → 0.3.5__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_gc-0.3.3 → markitdown_gc-0.3.5}/PKG-INFO +3 -3
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/README.md +2 -2
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/__about__.py +1 -1
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_xlsx_converter.py +50 -1
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/.gitignore +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/LICENSE +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/ThirdPartyNotices.md +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/pyproject.toml +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/GUIDE.md +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/__init__.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/__main__.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/_base_converter.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/_exceptions.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/_hwp_media.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/_markitdown.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/_media.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/_stream_info.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/_text.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/_uri_utils.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converter_utils/__init__.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converter_utils/_image.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converter_utils/_xlsx_images.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converter_utils/docx/__init__.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converter_utils/docx/_images.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converter_utils/docx/math/__init__.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converter_utils/docx/math/latex_dict.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converter_utils/docx/math/omml.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converter_utils/docx/pre_process.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/__init__.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_audio_converter.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_bing_serp_converter.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_csv_converter.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_cu_converter.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_doc_intel_converter.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_docx_converter.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_epub_converter.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_exiftool.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_html_converter.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_hwp_converter.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_image_converter.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_ipynb_converter.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_llm_caption.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_markdownify.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_outlook_msg_converter.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_pdf_converter.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_plain_text_converter.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_pptx_converter.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_rss_converter.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_transcribe_audio.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_wikipedia_converter.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_youtube_converter.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_zip_converter.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/ocr_triage.py +0 -0
- {markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: markitdown-gc
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.5
|
|
4
4
|
Summary: Utility tool for converting various files to Markdown
|
|
5
5
|
Project-URL: Documentation, https://github.com/greatgc-flow/markitdown-gc#readme
|
|
6
6
|
Project-URL: Issues, https://github.com/greatgc-flow/markitdown-gc/issues
|
|
@@ -112,8 +112,8 @@ From source:
|
|
|
112
112
|
|
|
113
113
|
```bash
|
|
114
114
|
git clone https://github.com/greatgc-flow/markitdown-gc.git
|
|
115
|
-
cd markitdown
|
|
116
|
-
pip install -e
|
|
115
|
+
cd markitdown-gc
|
|
116
|
+
pip install -e packages/markitdown
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
## Usage
|
|
@@ -261,6 +261,55 @@ class XlsxConverter(DocumentConverter):
|
|
|
261
261
|
return None
|
|
262
262
|
|
|
263
263
|
|
|
264
|
+
def _read_xls_sheets(file_stream: BinaryIO) -> dict[str, Any]:
|
|
265
|
+
"""Tolerate damaged UTF-16 only while xlrd eagerly loads the workbook."""
|
|
266
|
+
originals = {
|
|
267
|
+
module: module.unicode
|
|
268
|
+
for name, module in list(sys.modules.items())
|
|
269
|
+
if (name == "xlrd" or name.startswith("xlrd.")) and hasattr(module, "unicode")
|
|
270
|
+
}
|
|
271
|
+
replaced = 0
|
|
272
|
+
|
|
273
|
+
def tolerant_unicode(data: bytes, encoding: str) -> str:
|
|
274
|
+
nonlocal replaced
|
|
275
|
+
try:
|
|
276
|
+
return data.decode(encoding)
|
|
277
|
+
except UnicodeDecodeError as exc:
|
|
278
|
+
if not exc.encoding.replace("-", "_").startswith("utf_16"):
|
|
279
|
+
raise
|
|
280
|
+
text = data.decode(encoding, errors="replace")
|
|
281
|
+
# Exclude literal U+FFFD characters already present in the input.
|
|
282
|
+
replaced += text.count("\ufffd") - data.decode(
|
|
283
|
+
encoding, errors="ignore"
|
|
284
|
+
).count("\ufffd")
|
|
285
|
+
return text
|
|
286
|
+
|
|
287
|
+
original_open = xlrd.open_workbook
|
|
288
|
+
|
|
289
|
+
def open_workbook(*args: Any, **kwargs: Any) -> Any:
|
|
290
|
+
try:
|
|
291
|
+
for module in originals:
|
|
292
|
+
module.unicode = tolerant_unicode
|
|
293
|
+
kwargs["on_demand"] = False
|
|
294
|
+
return original_open(*args, **kwargs)
|
|
295
|
+
finally:
|
|
296
|
+
for module, original in originals.items():
|
|
297
|
+
module.unicode = original
|
|
298
|
+
|
|
299
|
+
try:
|
|
300
|
+
xlrd.open_workbook = open_workbook
|
|
301
|
+
sheets = pd.read_excel(file_stream, sheet_name=None, engine="xlrd")
|
|
302
|
+
finally:
|
|
303
|
+
xlrd.open_workbook = original_open
|
|
304
|
+
if replaced:
|
|
305
|
+
warnings.warn(
|
|
306
|
+
f"Replaced {replaced} invalid UTF-16 sequence(s) in XLS strings with U+FFFD. Verify output.",
|
|
307
|
+
UserWarning,
|
|
308
|
+
stacklevel=2,
|
|
309
|
+
)
|
|
310
|
+
return sheets
|
|
311
|
+
|
|
312
|
+
|
|
264
313
|
class XlsConverter(DocumentConverter):
|
|
265
314
|
"""
|
|
266
315
|
Converts XLS files to Markdown, with each sheet presented as a separate Markdown table.
|
|
@@ -348,7 +397,7 @@ class XlsConverter(DocumentConverter):
|
|
|
348
397
|
_xls_dependency_exc_info[2]
|
|
349
398
|
)
|
|
350
399
|
|
|
351
|
-
sheets =
|
|
400
|
+
sheets = _read_xls_sheets(file_stream)
|
|
352
401
|
md_content = ""
|
|
353
402
|
for s in sheets:
|
|
354
403
|
md_content += f"## {s}\n"
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converter_utils/docx/math/__init__.py
RENAMED
|
File without changes
|
{markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converter_utils/docx/math/latex_dict.py
RENAMED
|
File without changes
|
{markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converter_utils/docx/math/omml.py
RENAMED
|
File without changes
|
{markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converter_utils/docx/pre_process.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_bing_serp_converter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_doc_intel_converter.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_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_outlook_msg_converter.py
RENAMED
|
File without changes
|
|
File without changes
|
{markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_plain_text_converter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{markitdown_gc-0.3.3 → markitdown_gc-0.3.5}/src/markitdown/converters/_wikipedia_converter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|