Skip to content

Commit 1bd206a

Browse files
authored
Merge branch 'main' into fix/xlsx-sheetview-showzeroes
2 parents d823f6c + 22db170 commit 1bd206a

45 files changed

Lines changed: 2122 additions & 178 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "weekly"
7+
cooldown:
8+
default-days: 7

.github/workflows/pre-commit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ jobs:
55
pre-commit:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v5
8+
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
99
- name: Set up Python
10-
uses: actions/setup-python@v5
10+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
1111
with:
1212
python-version: "3.x"
1313

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ jobs:
55
tests:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v5
9-
- uses: actions/setup-python@v5
8+
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
9+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
1010
with:
1111
python-version: |
1212
3.10

README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ MarkItDown currently supports the conversion from:
2020
- HTML
2121
- Text-based formats (CSV, JSON, XML)
2222
- ZIP files (iterates over contents)
23-
- Youtube URLs
23+
- YouTube URLs
2424
- EPubs
2525
- ... and more!
2626

@@ -188,6 +188,13 @@ Content Understanding is ideal when you need capabilities beyond what built-in o
188188
markitdown path-to-file.pdf --use-cu --cu-endpoint "<content_understanding_endpoint>"
189189
```
190190

191+
The endpoint can also be set once in the environment, so callers only need `--use-cu`:
192+
193+
```bash
194+
export MARKITDOWN_CU_ENDPOINT="<content_understanding_endpoint>"
195+
markitdown path-to-file.pdf --use-cu
196+
```
197+
191198
**Python API:**
192199

193200
```python
@@ -244,6 +251,13 @@ To use Microsoft Document Intelligence for conversion:
244251
markitdown path-to-file.pdf -o document.md -d -e "<document_intelligence_endpoint>"
245252
```
246253

254+
The endpoint can also be set once in the environment, so callers only need `-d`:
255+
256+
```bash
257+
export MARKITDOWN_DOCINTEL_ENDPOINT="<document_intelligence_endpoint>"
258+
markitdown path-to-file.pdf -o document.md -d
259+
```
260+
247261
More information about how to set up an Azure Document Intelligence Resource can be found [here](https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/how-to-guides/create-document-intelligence-resource?view=doc-intel-4.0.0)
248262

249263
### Python API
@@ -341,9 +355,9 @@ You can help by looking at issues or helping review PRs. Any issue or PR is welc
341355

342356
### Security Considerations
343357

344-
MarkItDown performs I/O with the privileges of the current process. Like `open()` or `requests.get()`, it will access resources that the process itself can access.
358+
MarkItDown performs I/O with the privileges of the current process. Like `open()` or `requests.get()`, it will access resources that the process itself can access.
345359

346-
**Sanitize your inputs:** Do not pass untrusted input directly to MarkItDown. If any part of the input may be controlled by an untrusted user or system, such as in hosted or server-side applications, it must be validated and restricted before calling MarkItDown. Depending on your environment, this may include restricting file paths, limiting URI schemes and network destinations, and blocking access to private, loopback, link-local, or metadata-service addresses.
360+
**Sanitize your inputs:** Do not pass untrusted input directly to MarkItDown. If any part of the input may be controlled by an untrusted user or system, such as in hosted or server-side applications, it must be validated and restricted before calling MarkItDown. Depending on your environment, this may include restricting file paths, limiting URI schemes and network destinations, and blocking access to private, loopback, link-local, or metadata-service addresses.
347361

348362
**Call only the conversion method you need:** Prefer the narrowest conversion API that fits your use case. MarkItDown's `convert()` method is intentionally permissive and can handle local files, remote URIs, and byte streams. If your application only needs to read local files, call `convert_local()` instead. If you need more control over URI fetching, call `requests.get()` yourself and pass the response object to `convert_response()`. For maximum control, open a stream to the input you want converted and call `convert_stream()`.
349363

packages/markitdown-mcp/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ pip install markitdown-mcp
2525
To run the MCP server, using STDIO (default), use the following command:
2626

2727

28-
```bash
28+
```bash
2929
markitdown-mcp
3030
```
3131

3232
To run the MCP server, using Streamable HTTP and SSE, use the following command:
3333

34-
```bash
34+
```bash
3535
markitdown-mcp --http --host 127.0.0.1 --port 3001
3636
```
3737

@@ -86,12 +86,12 @@ If you want to mount a directory, adjust it accordingly:
8686
"markitdown": {
8787
"command": "docker",
8888
"args": [
89-
"run",
90-
"--rm",
91-
"-i",
92-
"-v",
93-
"/home/user/data:/workdir",
94-
"markitdown-mcp:latest"
89+
"run",
90+
"--rm",
91+
"-i",
92+
"-v",
93+
"/home/user/data:/workdir",
94+
"markitdown-mcp:latest"
9595
]
9696
}
9797
}

packages/markitdown-sample-plugin/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77

88
This project shows how to create a sample plugin for MarkItDown. The most important parts are as follows:
99

10-
Next, implement your custom DocumentConverter:
10+
First, implement your custom DocumentConverter:
1111

1212
```python
1313
from typing import BinaryIO, Any
14-
from markitdown import MarkItDown, DocumentConverter, DocumentConverterResult, StreamInfo
14+
from markitdown import MarkItDown, DocumentConverter, DocumentConverterResult, StreamInfo, PRIORITY_SPECIFIC_FILE_FORMAT
1515

1616
class RtfConverter(DocumentConverter):
1717

1818
def __init__(
19-
self, priority: float = DocumentConverter.PRIORITY_SPECIFIC_FILE_FORMAT
19+
self, priority: float = PRIORITY_SPECIFIC_FILE_FORMAT
2020
):
2121
super().__init__(priority=priority)
2222

@@ -26,10 +26,10 @@ class RtfConverter(DocumentConverter):
2626
stream_info: StreamInfo,
2727
**kwargs: Any,
2828
) -> bool:
29-
30-
# Implement logic to check if the file stream is an RTF file
31-
# ...
32-
raise NotImplementedError()
29+
30+
# Implement logic to check if the file stream is an RTF file
31+
# ...
32+
raise NotImplementedError()
3333

3434

3535
def convert(
@@ -39,17 +39,17 @@ class RtfConverter(DocumentConverter):
3939
**kwargs: Any,
4040
) -> DocumentConverterResult:
4141

42-
# Implement logic to convert the file stream to Markdown
43-
# ...
44-
raise NotImplementedError()
42+
# Implement logic to convert the file stream to Markdown
43+
# ...
44+
raise NotImplementedError()
4545
```
4646

4747
Next, make sure your package implements and exports the following:
4848

4949
```python
50-
# The version of the plugin interface that this plugin uses.
50+
# The version of the plugin interface that this plugin uses.
5151
# The only supported version is 1 for now.
52-
__plugin_interface_version__ = 1
52+
__plugin_interface_version__ = 1
5353

5454
# The main entrypoint for the plugin. This is called each time MarkItDown instances are created.
5555
def register_converters(markitdown: MarkItDown, **kwargs):
@@ -97,7 +97,7 @@ In Python, plugins can be enabled as follows:
9797
```python
9898
from markitdown import MarkItDown
9999

100-
md = MarkItDown(enable_plugins=True)
100+
md = MarkItDown(enable_plugins=True)
101101
result = md.convert("path-to-file.rtf")
102102
print(result.text_content)
103103
```

packages/markitdown-sample-plugin/src/markitdown_sample_plugin/_plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def register_converters(markitdown: MarkItDown, **kwargs):
3333

3434
class RtfConverter(DocumentConverter):
3535
"""
36-
Converts an RTF file to in the simplest possible way.
36+
Converts an RTF file in the simplest possible way.
3737
"""
3838

3939
def accepts(
@@ -60,7 +60,7 @@ def convert(
6060
stream_info: StreamInfo,
6161
**kwargs: Any,
6262
) -> DocumentConverterResult:
63-
# Read the file stream into an str using hte provided charset encoding, or using the system default
63+
# Read the file stream into a str using the provided charset encoding, or using the system default
6464
encoding = stream_info.charset or locale.getpreferredencoding()
6565
stream_data = file_stream.read().decode(encoding)
6666

packages/markitdown-sample-plugin/tests/test_sample_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
def test_converter() -> None:
16-
"""Tests the RTF converter dirctly."""
16+
"""Tests the RTF converter directly."""
1717
with open(os.path.join(TEST_FILES_DIR, "test.rtf"), "rb") as file_stream:
1818
converter = RtfConverter()
1919
result = converter.convert(

packages/markitdown/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# MarkItDown
22

33
> [!TIP]
4-
> MarkItDown is a Python package and command-line utility for converting various files to Markdown (e.g., for indexing, text analysis, etc).
4+
> MarkItDown is a Python package and command-line utility for converting various files to Markdown (e.g., for indexing, text analysis, etc).
55
>
66
> For more information, and full documentation, see the project [README.md](https://github.com/microsoft/markitdown) on GitHub.
77
@@ -13,15 +13,15 @@
1313
From PyPI:
1414

1515
```bash
16-
pip install markitdown[all]
16+
pip install 'markitdown[all]'
1717
```
1818

1919
From source:
2020

2121
```bash
2222
git clone git@github.com:microsoft/markitdown.git
2323
cd markitdown
24-
pip install -e packages/markitdown[all]
24+
pip install -e 'packages/markitdown[all]'
2525
```
2626

2727
## Usage
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# SPDX-FileCopyrightText: 2024-present Adam Fourney <adamfo@microsoft.com>
22
#
33
# SPDX-License-Identifier: MIT
4-
__version__ = "0.1.6"
4+
__version__ = "0.1.7"

0 commit comments

Comments
 (0)