From 4afc1fe886b5d98afa11520dcb61105beb610cb1 Mon Sep 17 00:00:00 2001 From: Kenny Zhang Date: Fri, 21 Feb 2025 13:31:37 -0500 Subject: [PATCH] added non-binary example to README --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7e6f72b..8a2235f 100644 --- a/README.md +++ b/README.md @@ -103,10 +103,16 @@ MarkItDown also supports converting file objects directly: from markitdown import MarkItDown md = MarkItDown() -path = "test.docx" -with open(path, 'rb') as file: + +# Binary Mode +with open("test.docx", 'rb') as file: result = md.convert(file, file_extension=".docx") print(result.text_content) + +# Non-Binary Mode +with open("sample.ipynb", 'rt', encoding="utf-8") as file: + result = md.convert(file, file_extension=".ipynb") + print(result.text_content) ``` To use Large Language Models for image descriptions, provide `llm_client` and `llm_model`: