From 3f9ba0641800fbdd82038cbbd0727f31b191cb27 Mon Sep 17 00:00:00 2001 From: gagb Date: Thu, 12 Dec 2024 15:17:18 -0800 Subject: [PATCH 1/4] Improve the readme with contributing guidelines Addresses issue https://github.com/microsoft/markitdown/issues/6 --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/microsoft/markitdown?shareId=XXXX-XXXX-XXXX-XXXX). --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 5034d03..1bb1b7d 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,30 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. +## Installation + +To install the dependencies for this project, run the following command in the root of the project: + +```sh +pip install -e . +``` + +## Running Tests + +To run the tests for this project, use the following command: + +```sh +pytest +``` + +## Running Pre-commit Checks + +If there are pre-commit hooks configured (indicated by the `.pre-commit-config.yaml`), you can test them by running: + +```sh +pre-commit run --all-files +``` + ## Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft From 18301edcd02fbb5a097a5513104a5b5c8e564574 Mon Sep 17 00:00:00 2001 From: Robert Haase Date: Sat, 14 Dec 2024 23:22:54 +0100 Subject: [PATCH 2/4] Add installation instructions --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 5034d03..267483b 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,14 @@ result = markitdown.convert("test.xlsx") print(result.text_content) ``` +## Installation + +MarkItDown can be installed using pip: + +``` +pip install markitdown +``` + ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a From 30ab78fe9efe4dd59e5499aae34b0c07cd6d1478 Mon Sep 17 00:00:00 2001 From: Sandeep Pawar <62612119+pawarbi@users.noreply.github.com> Date: Sat, 14 Dec 2024 19:15:10 -0600 Subject: [PATCH 3/4] Update README.md I have updated the readme with three changes: - Created sections for Installation and Usage to help users - Added installation instruction - Added additional example of using LLM. This will be the primary use case and will help users. --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 5034d03..7958b0d 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,14 @@ It presently supports: - HTML (special handling of Wikipedia, etc.) - Various other text-based formats (csv, json, xml, etc.) +# Installation + +You can install `markitdown` using pip: + +```python +pip install markitdown +``` +# Usage The API is simple: ```python @@ -23,6 +31,18 @@ result = markitdown.convert("test.xlsx") print(result.text_content) ``` +You can also configure markitdown to use Large Language Models to describe images. To do so you must provide mlm_client and mlm_model parameters to MarkItDown object, according to your specific client. + +```python +from markitdown import MarkItDown +from openai import OpenAI + +client = OpenAI() +md = MarkItDown(mlm_client=client, mlm_model="gpt-4o") +result = md.convert("example.jpg") +print(result.text_content) +``` + ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a From 5753e553fe5b982a67d728018df8fbce746a567d Mon Sep 17 00:00:00 2001 From: gagb Date: Sat, 14 Dec 2024 18:47:34 -0800 Subject: [PATCH 4/4] Fix conflicts --- README.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index af5af47..15cc622 100644 --- a/README.md +++ b/README.md @@ -65,20 +65,16 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. -## Installation - -To install the dependencies for this project, run the following command in the root of the project: - - -## Running Tests +### Running Tests To run the tests for this project, use the following command: ```sh -pytest +hatch shell +hatch test ``` -## Running Pre-commit Checks +### Running Pre-commit Checks If there are pre-commit hooks configured (indicated by the `.pre-commit-config.yaml`), you can test them by running: