Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

doc_to_md_cli-0.1.1.tar.gz (25.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

doc_to_md_cli-0.1.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file doc_to_md_cli-0.1.1.tar.gz.

File metadata

  • Download URL: doc_to_md_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 25.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for doc_to_md_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ed1109f0056bdb196681b4bc2d7450cdeb44b4d6de0e91c6bcf7b165f7cde1f5
MD5 566be7c391fa3699a578f1c8bb651297
BLAKE2b-256 7d636c747acc513e77adbf7b953bc361afe25f98abeb3a6a348c781d70934547

See more details on using hashes here.

File details

Details for the file doc_to_md_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: doc_to_md_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for doc_to_md_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 11d14ef326177172225cfd3c820326e88106ad881a7e173310ba6c9265e32f64
MD5 e218fa798c58bbca10c0c98bb6b8e41b
BLAKE2b-256 b3b628edf7f2a2af08a9acbb0c621af4d3f9daa5e3dd6a4aea5aabd195b291c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page