Convert DOCX files to Markdown using Playwright
Project description
doc-to-md-cli
A Python library and CLI tool to convert DOCX files to Markdown using Playwright automation.
Features
- Convert single DOCX files or entire directories
- Batch processing support
- Headless browser mode for automation
- Clean Markdown output powered by word2md.com
- Use as a CLI tool or import as a Python library
Installation
pip install doc-to-md-cli
Install Playwright browser (required):
playwright install chromium
Usage
CLI
Convert a single file:
doc-to-md document.docx
Convert to a specific output directory:
doc-to-md document.docx --out ./output
Convert all DOCX files in a directory:
doc-to-md ./my-docs --out ./converted
Show browser window (non-headless mode):
doc-to-md document.docx --no-headless
Python API
from doc2md import convert_docx_to_md
# Convert a single file
files = convert_docx_to_md("document.docx", "output")
print(files) # ['output/document.md']
# Convert all files in a directory
files = convert_docx_to_md("./my-docs", "output")
# ['output/file1.md', 'output/file2.md', ...]
# Convert with browser visible
files = convert_docx_to_md("document.docx", headless=False)
Requirements
- Python 3.8 or higher
- Playwright (installed automatically)
License
MIT License - see LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file doc_to_md_cli-0.1.2.tar.gz.
File metadata
- Download URL: doc_to_md_cli-0.1.2.tar.gz
- Upload date:
- Size: 25.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.20 {"installer":{"name":"uv","version":"0.9.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Pop!_OS","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d263e31cd38f959a8c452b5dd9851eb28be95784e1948fd5dd555e8f04d9a9a7
|
|
| MD5 |
43af0437511d32cab6595488e96a036f
|
|
| BLAKE2b-256 |
4acfc569eaca8380bc75c5138a22cc2fbe6a866af82cdefb0b35c75bd003e227
|
File details
Details for the file doc_to_md_cli-0.1.2-py3-none-any.whl.
File metadata
- Download URL: doc_to_md_cli-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.20 {"installer":{"name":"uv","version":"0.9.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Pop!_OS","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4400b64bba1c68cc166053382748962d0e102f6f940ab0823a1ae417822e2e97
|
|
| MD5 |
ae76827392772c7f7a196a80d9b21de3
|
|
| BLAKE2b-256 |
6b106a5b38d362752423174d1f31d5052ba03bf7b5eb13d87abd044e8fc114fc
|