added non-binary example to README
This commit is contained in:
10
README.md
10
README.md
@@ -103,10 +103,16 @@ MarkItDown also supports converting file objects directly:
|
|||||||
from markitdown import MarkItDown
|
from markitdown import MarkItDown
|
||||||
|
|
||||||
md = 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")
|
result = md.convert(file, file_extension=".docx")
|
||||||
print(result.text_content)
|
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`:
|
To use Large Language Models for image descriptions, provide `llm_client` and `llm_model`:
|
||||||
|
|||||||
Reference in New Issue
Block a user