6 views
microsoft/markitdown
Python tool for converting files and office documents to Markdown.
Python★ 181,868+2,047 that day#5 on trending
7.68%duplicated code · 709 of 9,231 lines
39clones in code
53code files of 108 scanned
6.59%duplicated over all files · 91 clones
The code number leaves out tests, fixtures, docs, examples, data files, styles, translations and vendored code.
Largest clones in the code
- 24 lines in 4 placespython100 tokenspackages/markitdown/src/markitdown/converters/_audio_converter.py:28–51packages/markitdown/src/markitdown/converters/_csv_converter.py:54–74packages/markitdown/src/markitdown/converters/_html_converter.py:24–47packages/markitdown/src/markitdown/converters/_zip_converter.py:69–92
28def accepts( 29 self, 30 file_stream: BinaryIO, 31 stream_info: StreamInfo, 32 **kwargs: Any, # Options to pass to the converter 33) -> bool: 34 mimetype = (stream_info.mimetype or "").lower() 35 extension = (stream_info.extension or "").lower() 36 37 if extension in ACCEPTED_FILE_EXTENSIONS:54def accepts( 55 self, 56 file_stream: BinaryIO, 57 stream_info: StreamInfo, 58 **kwargs: Any, # Options to pass to the converter 59) -> bool: 60 mimetype = (stream_info.mimetype or "").lower() 61 extension = (stream_info.extension or "").lower() 62 if extension in ACCEPTED_FILE_EXTENSIONS: 63 return TrueFirst 10 of 24 lines, the second copy on the right.
- 31 lines in 3 placespython143 tokenspackages/markitdown/src/markitdown/converters/_docx_converter.py:45–75packages/markitdown/src/markitdown/converters/_epub_converter.py:28–58packages/markitdown/src/markitdown/converters/_pptx_converter.py:36–66
45Converts DOCX files to Markdown. Style information (e.g., headings) and tables are preserved where possible. 46""" 47 48def __init__(self): 49 super().__init__() 50 self._html_converter = HtmlConverter() 51 52def accepts( 53 self, 54 file_stream: BinaryIO,First 10 of 31 lines.
- 16 lines in 4 placespython54 tokenspackages/markitdown-ocr/src/markitdown_ocr/_docx_converter_with_ocr.py:70–85packages/markitdown-ocr/src/markitdown_ocr/_pdf_converter_with_ocr.py:153–168packages/markitdown-ocr/src/markitdown_ocr/_pptx_converter_with_ocr.py:49–64packages/markitdown/src/markitdown/converters/_pdf_converter.py:515–530
70 ): 71 return True 72 73 return False 74 75def convert( 76 self, 77 file_stream: BinaryIO, 78 stream_info: StreamInfo, 79 **kwargs: Any,First 10 of 16 lines.
7 more
- 42 lines in 2 placespython152 tokens
- 26 lines in 2 placespython148 tokens
- 18 lines in 3 placespython52 tokens
- 23 lines in 2 placespython102 tokens
- 27 lines in 2 placespython101 tokens
- 26 lines in 2 placespython96 tokens
- 18 lines in 2 placespython91 tokens
Largest clones over all files, tests and data included
- 17 lines in 4 placespythontests108 tokenspackages/markitdown/tests/test_pdf_tables.py:735–751packages/markitdown/tests/test_pdf_tables.py:788–804packages/markitdown/tests/test_pdf_tables.py:830–846packages/markitdown/tests/test_pdf_tables.py:913–929
735) 736 737if not os.path.exists(pdf_path): 738 pytest.skip(f"Test file not found: {pdf_path}") 739 740if not os.path.exists(expected_path): 741 pytest.skip(f"Expected output not found: {expected_path}") 742 743result = markitdown.convert(pdf_path) 744actual_output = result.text_contentFirst 10 of 17 lines.
- 24 lines in 4 placespython100 tokenspackages/markitdown/src/markitdown/converters/_audio_converter.py:28–51packages/markitdown/src/markitdown/converters/_csv_converter.py:54–74packages/markitdown/src/markitdown/converters/_html_converter.py:24–47packages/markitdown/src/markitdown/converters/_zip_converter.py:69–92
28def accepts( 29 self, 30 file_stream: BinaryIO, 31 stream_info: StreamInfo, 32 **kwargs: Any, # Options to pass to the converter 33) -> bool: 34 mimetype = (stream_info.mimetype or "").lower() 35 extension = (stream_info.extension or "").lower() 36 37 if extension in ACCEPTED_FILE_EXTENSIONS:54def accepts( 55 self, 56 file_stream: BinaryIO, 57 stream_info: StreamInfo, 58 **kwargs: Any, # Options to pass to the converter 59) -> bool: 60 mimetype = (stream_info.mimetype or "").lower() 61 extension = (stream_info.extension or "").lower() 62 if extension in ACCEPTED_FILE_EXTENSIONS: 63 return TrueFirst 10 of 24 lines, the second copy on the right.
- 31 lines in 3 placespython143 tokenspackages/markitdown/src/markitdown/converters/_docx_converter.py:45–75packages/markitdown/src/markitdown/converters/_epub_converter.py:28–58packages/markitdown/src/markitdown/converters/_pptx_converter.py:36–66
45Converts DOCX files to Markdown. Style information (e.g., headings) and tables are preserved where possible. 46""" 47 48def __init__(self): 49 super().__init__() 50 self._html_converter = HtmlConverter() 51 52def accepts( 53 self, 54 file_stream: BinaryIO,First 10 of 31 lines.
- 8 lines in 4 placespythontests91 tokens
- 7 lines in 4 placesmarkdowndocs and examples72 tokens
By format, code only
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| python | 43 | 8,413 | 39 | 709 | 8.43% |
| bash | 9 | 644 | 0 | 0 | 0% |
| perl | 1 | 174 | 0 | 0 | 0% |
By format, all files
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| python | 70 | 16,006 | 83 | 1,319 | 8.24% |
| markdown | 14 | 1,545 | 5 | 36 | 2.33% |
| toml | 4 | 311 | 2 | 36 | 11.58% |
| yaml | 2 | 66 | 1 | 12 | 18.18% |
| markup | 3 | 2,448 | 0 | 0 | 0% |
| bash | 12 | 688 | 0 | 0 | 0% |
| perl | 1 | 174 | 0 | 0 | 0% |
| json | 2 | 60 | 0 | 0 | 0% |
Trending appearances
| Day | Rank | Stars | Files | Lines | Clones | All files | Code | Health | Commit |
|---|---|---|---|---|---|---|---|---|---|
| Sep 9, 2026 | #5 | 181,868 (+2,047) | 108 | 21,298 | 91 | 6.59% | 7.68% | — | b6e8bbd |
| Sep 8, 2026 | #1 | 180,696 (+886) | 108 | 21,298 | 91 | 6.59% | 7.68% | — | b6e8bbd |
Want this for your own project? Install jscpd and run jscpd ., or measure it the way the baselines were measured.