Skip to content

Commit 91ddbb3

Browse files
committed
Add PyQt6 multi-file GUI for MarkItDown
1 parent 9dc0d65 commit 91ddbb3

6 files changed

Lines changed: 436 additions & 0 deletions

File tree

MARKITDOWN_GUI_SETUP.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# MarkItDown GUI Setup and Run Guide
2+
3+
This guide explains how to install dependencies and run the `markitdown-gui` desktop app.
4+
5+
## 1. Prerequisites
6+
7+
- Python 3.10+
8+
- PowerShell (Windows)
9+
- This repository cloned locally
10+
11+
## 2. Open the Project Folder
12+
13+
```powershell
14+
cd D:\develpment\FileConverterToMD
15+
```
16+
17+
## 3. Create and Activate Virtual Environment
18+
19+
```powershell
20+
python -m venv .venv
21+
.\.venv\Scripts\Activate.ps1
22+
```
23+
24+
If script execution is blocked in PowerShell, run:
25+
26+
```powershell
27+
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
28+
.\.venv\Scripts\Activate.ps1
29+
```
30+
31+
## 4. Install MarkItDown with GUI + DOCX Support
32+
33+
Recommended for GUI and Word files (`.docx`):
34+
35+
```powershell
36+
pip install -e "packages/markitdown[gui,docx]"
37+
```
38+
39+
Install all optional converters instead:
40+
41+
```powershell
42+
pip install -e "packages/markitdown[all,gui]"
43+
```
44+
45+
## 5. Run the GUI
46+
47+
Option A (dedicated command):
48+
49+
```powershell
50+
markitdown-gui
51+
```
52+
53+
Option B (through main CLI):
54+
55+
```powershell
56+
markitdown --gui
57+
```
58+
59+
## 6. Convert Files in the GUI
60+
61+
1. Click **Select Files** and choose one or more files.
62+
2. Choose output mode:
63+
- Keep **Save next to each source file** enabled, or
64+
- Disable it and select an **Output folder**.
65+
3. Click **Convert to Markdown**.
66+
4. Check the log panel for success/error messages.
67+
68+
Each selected input file produces one `.md` output file.
69+
70+
## 7. Quick Verification (Optional)
71+
72+
Check CLI install:
73+
74+
```powershell
75+
markitdown --version
76+
```
77+
78+
Quick single-file conversion test:
79+
80+
```powershell
81+
markitdown "D:\path\to\file.docx" -o "D:\path\to\file.md"
82+
```
83+
84+
## Troubleshooting
85+
86+
### Error: MissingDependencyException for `.docx`
87+
88+
Install DOCX dependencies:
89+
90+
```powershell
91+
pip install -e "packages/markitdown[docx]"
92+
```
93+
94+
or
95+
96+
```powershell
97+
pip install -e "packages/markitdown[gui,docx]"
98+
```
99+
100+
### Error on reinstall: Access denied for `markitdown-gui.exe`
101+
102+
Close any running GUI window, then reinstall:
103+
104+
```powershell
105+
pip install -e "packages/markitdown[gui,docx]"
106+
```
107+
108+
### Command not found (`markitdown-gui`)
109+
110+
- Ensure virtual environment is activated.
111+
- Reinstall package in editable mode:
112+
113+
```powershell
114+
pip install -e "packages/markitdown[gui,docx]"
115+
```

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,28 @@ You can also pipe content:
8888
cat path-to-file.pdf | markitdown
8989
```
9090

91+
### Desktop UI (PyQt6)
92+
93+
Install with GUI support:
94+
95+
```bash
96+
pip install 'markitdown[gui]'
97+
```
98+
99+
Then launch:
100+
101+
```bash
102+
markitdown-gui
103+
```
104+
105+
You can also launch the same UI from the main CLI:
106+
107+
```bash
108+
markitdown --gui
109+
```
110+
111+
The UI supports selecting multiple files at once and writes one `.md` output per input file.
112+
91113
### Optional Dependencies
92114
MarkItDown has optional dependencies for activating various file formats. Earlier in this document, we installed all optional dependencies with the `[all]` option. However, you can also install them individually for more control. For example:
93115

@@ -100,6 +122,7 @@ will install only the dependencies for PDF, DOCX, and PPTX files.
100122
At the moment, the following optional dependencies are available:
101123

102124
* `[all]` Installs all optional dependencies
125+
* `[gui]` Installs dependencies for the PyQt6 desktop UI (multi-file conversion)
103126
* `[pptx]` Installs dependencies for PowerPoint files
104127
* `[docx]` Installs dependencies for Word files
105128
* `[xlsx]` Installs dependencies for Excel files

packages/markitdown/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,28 @@ pip install -e 'packages/markitdown[all]'
3232
markitdown path-to-file.pdf > document.md
3333
```
3434

35+
### Desktop UI (PyQt6)
36+
37+
Install the GUI extra:
38+
39+
```bash
40+
pip install 'markitdown[gui]'
41+
```
42+
43+
Launch the desktop app:
44+
45+
```bash
46+
markitdown-gui
47+
```
48+
49+
Or from the main CLI:
50+
51+
```bash
52+
markitdown --gui
53+
```
54+
55+
The desktop UI lets you select multiple files in one operation and converts each file to a `.md` Markdown file.
56+
3557
### Python API
3658

3759
```python

packages/markitdown/pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ all = [
5050
"azure-ai-contentunderstanding>=1.2.0b1",
5151
"azure-identity",
5252
]
53+
gui = ["PyQt6"]
5354
pptx = ["python-pptx"]
5455
docx = ["mammoth~=1.11.0", "lxml"]
5556
xlsx = ["pandas", "openpyxl"]
@@ -72,6 +73,7 @@ path = "src/markitdown/__about__.py"
7273

7374
[project.scripts]
7475
markitdown = "markitdown.__main__:main"
76+
markitdown-gui = "markitdown._qt_gui:main"
7577

7678
[tool.hatch.envs.default]
7779
features = ["all"]

packages/markitdown/src/markitdown/__main__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,21 @@ def main():
138138
help="Keep data URIs (like base64-encoded images) in the output. By default, data URIs are truncated.",
139139
)
140140

141+
parser.add_argument(
142+
"--gui",
143+
action="store_true",
144+
help="Launch the PyQt6 desktop UI for selecting and converting multiple files.",
145+
)
146+
141147
parser.add_argument("filename", nargs="?")
142148
args = parser.parse_args()
143149

150+
if args.gui:
151+
from ._qt_gui import main as gui_main
152+
153+
gui_main()
154+
return
155+
144156
# Parse the extension hint
145157
extension_hint = args.extension
146158
if extension_hint is not None:

0 commit comments

Comments
 (0)