Skip to main content

Convert Markdown <-> DOCX easily with full formatting support

Project description

md-ops

🔄 Convert Markdown ↔️ DOCX easily

A powerful Python library for converting between Markdown and DOCX formats with ease.

📦 Installation

pip install md-ops

🚀 Quick Start

Convert Markdown to DOCX

from md_ops import md_to_docx

markdown = """
# Hello World

This is **bold** and this is *italic*.

- Item 1
- Item 2
"""

md_to_docx(markdown, "output.docx")

Convert DOCX to Markdown

from md_ops import docx_to_md

markdown = docx_to_md("input.docx")
print(markdown)

📖 API Reference

md_to_docx(markdown_text, output_path='output.docx')

Converts Markdown text to a DOCX file.

Parameters:

  • markdown_text (str): The Markdown content to convert
  • output_path (str, optional): Output file path (default: 'output.docx')

Returns: str - Path to the created DOCX file

Example:

md_to_docx("# My Document", "my-file.docx")

docx_to_md(docx_path)

Converts a DOCX file to Markdown text.

Parameters:

  • docx_path (str): Path to the DOCX file

Returns: str - The Markdown content

Example:

markdown = docx_to_md("document.docx")

✨ Supported Features

Markdown → DOCX

  • ✅ Headings (H1-H6)
  • Bold and Italic text
  • Inline code
  • ✅ Code blocks
  • ✅ Links
  • ✅ Lists (ordered & unordered)
  • ✅ Blockquotes
  • ✅ Horizontal rules

DOCX → Markdown

  • ✅ Headings
  • ✅ Text formatting (bold, italic)
  • ✅ Lists
  • ✅ Blockquotes

🧪 Testing

Run the included test file:

python test.py

📄 License

Proprietary © Consult Anubhav - All Rights Reserved

👨‍💻 Author

Consult Anubhav


Made with ❤️ for developers who need easy document conversion

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

md_ops-1.0.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

md_ops-1.0.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file md_ops-1.0.0.tar.gz.

File metadata

  • Download URL: md_ops-1.0.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for md_ops-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f1fe2d8d3cd10cad6228066fe4abd6a6f94d344110ea08c11c573d02b0fd628c
MD5 4303b24d8cc7904c3823eb02a8520be2
BLAKE2b-256 3404b643ac845bff414a2d1ae14a505771aa8546643b9e5c18cca9033b4b862a

See more details on using hashes here.

File details

Details for the file md_ops-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: md_ops-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for md_ops-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ea416d854117555078f9491c0bba4be108184fda747436253f1a42eb0d7db782
MD5 32a435fc9958d3a213617a88a088fc4b
BLAKE2b-256 6931bcaadb502ef1eb5c3b255dfc1eae63fbffa92c9f15b9d93e2534318305fd

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