markitdown-gc 0.3.4__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.
Files changed (54) hide show
  1. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/PKG-INFO +1 -1
  2. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/__about__.py +1 -1
  3. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_xlsx_converter.py +50 -1
  4. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/.gitignore +0 -0
  5. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/LICENSE +0 -0
  6. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/README.md +0 -0
  7. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/ThirdPartyNotices.md +0 -0
  8. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/pyproject.toml +0 -0
  9. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/GUIDE.md +0 -0
  10. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/__init__.py +0 -0
  11. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/__main__.py +0 -0
  12. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/_base_converter.py +0 -0
  13. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/_exceptions.py +0 -0
  14. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/_hwp_media.py +0 -0
  15. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/_markitdown.py +0 -0
  16. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/_media.py +0 -0
  17. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/_stream_info.py +0 -0
  18. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/_text.py +0 -0
  19. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/_uri_utils.py +0 -0
  20. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converter_utils/__init__.py +0 -0
  21. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converter_utils/_image.py +0 -0
  22. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converter_utils/_xlsx_images.py +0 -0
  23. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converter_utils/docx/__init__.py +0 -0
  24. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converter_utils/docx/_images.py +0 -0
  25. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converter_utils/docx/math/__init__.py +0 -0
  26. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converter_utils/docx/math/latex_dict.py +0 -0
  27. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converter_utils/docx/math/omml.py +0 -0
  28. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converter_utils/docx/pre_process.py +0 -0
  29. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/__init__.py +0 -0
  30. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_audio_converter.py +0 -0
  31. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_bing_serp_converter.py +0 -0
  32. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_csv_converter.py +0 -0
  33. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_cu_converter.py +0 -0
  34. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_doc_intel_converter.py +0 -0
  35. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_docx_converter.py +0 -0
  36. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_epub_converter.py +0 -0
  37. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_exiftool.py +0 -0
  38. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_html_converter.py +0 -0
  39. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_hwp_converter.py +0 -0
  40. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_image_converter.py +0 -0
  41. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_ipynb_converter.py +0 -0
  42. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_llm_caption.py +0 -0
  43. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_markdownify.py +0 -0
  44. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_outlook_msg_converter.py +0 -0
  45. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_pdf_converter.py +0 -0
  46. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_plain_text_converter.py +0 -0
  47. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_pptx_converter.py +0 -0
  48. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_rss_converter.py +0 -0
  49. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_transcribe_audio.py +0 -0
  50. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_wikipedia_converter.py +0 -0
  51. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_youtube_converter.py +0 -0
  52. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/converters/_zip_converter.py +0 -0
  53. {markitdown_gc-0.3.4 → markitdown_gc-0.3.5}/src/markitdown/ocr_triage.py +0 -0
  54. {markitdown_gc-0.3.4 → 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.4
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
@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2024-present Adam Fourney <adamfo@microsoft.com>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "0.3.4"
4
+ __version__ = "0.3.5"
@@ -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 = pd.read_excel(file_stream, sheet_name=None, engine="xlrd")
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