MDToWord
A Python package that converts Markdown files to Word documents with advanced formatting options.
Installation
pip install mdtoword
Usage
from mdtoword import MarkdownToDocxConverter
# Create a converter instance
converter = MarkdownToDocxConverter()
# Convert markdown to docx
converter.convert_file("input.md", "output.docx")
# Or convert markdown string directly
markdown_text = "# Hello World\nThis is a **bold** text"
converter.convert_string(markdown_text, "output.docx")
Features
- Converts Markdown to Word documents (.docx)
- Supports various Markdown formatting:
- Headers
- Bold and italic text
- Lists (ordered and unordered)
- Code blocks
- Tables
- Links
- Images
- Customizable styles and formatting
- Page numbering support
- Table of contents generation
Configuration
You can customize the document styling:
converter = MarkdownToDocxConverter(
styles={
'document': {
'font_name': 'Arial',
'font_size': 12,
'margins': {
'top': 1.0,
'bottom': 1.0,
'left': 1.0,
'right': 1.0
}
}
}
)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for mdtoword 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mdtoword-0.1.0.tar.gz | 6.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mdtoword-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.4 kB
Release files / mdtoword-0.1.0.tar.gz
| Download URL | mdtoword-0.1.0.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
49c93770d2c7a3de06a084c44bc0fa29f66ae0baac4a9a3c4c43c9095fb7add1
|
|
BLAKE2b-256 checksum How to use checksums |
cf434b8f68fa9da9974745d46678b5f293582bc82c37da80e38baabed52f5f77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.11
|
Release files / mdtoword-0.1.0-py3-none-any.whl
| Download URL | mdtoword-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f475b5445b5cd30d801641275ef67e4f970cf3007c8b11aedc2387663e942c9d
|
|
BLAKE2b-256 checksum How to use checksums |
ed315918b4e4be155457d7b4d9347bf917635aec1b9950cf748b6e24d6a2b8d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.11
|