Skip to main content

Convert HTML from TinyMCE (or other WYSIWYG editors) into .docx documents easily. Designed for developers looking to integrate rich text export functionality into their Python applications. Contributions welcome!

Project description

Super Tiny2Docx

PyPI Python Version License: MIT

Convert HTML from TinyMCE (or other WYSIWYG editors) into .docx documents easily. Designed for developers looking to integrate rich text export functionality into their Python applications. Supports tables, lists, styles, and more.

Contributions welcome!

✨ Features

  • Convert HTML to .docx with accurate formatting.
  • Supports paragraphs, headings, lists (ordered & unordered), tables, and inline styles.
  • Handles CSS-like styling (font, size, color, alignment, margins, borders, etc.).
  • Proper style inheritance for nested elements.
  • Preserves spaces and line breaks.
  • Extensible architecture for adding new features.

📦 Installation

pip install super_tiny2docx

🚀 Quick Start

from super_tiny2docx import SuperTiny2Docx

# Example HTML content
html_content = """
<h1>Welcome to Super Tiny2Docx</h1>
<p>This is a <strong>bold</strong> paragraph with <em>emphasis</em>.</p>
<ol>
    <li>First ordered list item</li>
    <li>Second ordered list item</li>
</ol>
<table border="1">
    <tr>
        <th>Header 1</th>
        <th>Header 2</th>
    </tr>
    <tr>
        <td>Data 1</td>
        <td>Data 2</td>
    </tr>
</table>
"""

# Convert to DOCX
converter = SuperTiny2Docx(html_content)
docx_bytes = converter.convert()

# Save to file
with open("output.docx", "wb") as f:
    f.write(docx_bytes.read())

print("Document saved as output.docx")

🛠️ Advanced Usage

Super Tiny2Docx automatically parses inline styles and <style> tags to apply formatting.

You can customize the default styles by extending the ComputedStyle class.

Contributing

We welcome contributions! Whether it's bug reports, feature suggestions, code improvements, or documentation fixes — your help is appreciated. Fork the repository. Create a new branch for your feature or bug fix. Add your changes and write tests if applicable. Submit a pull request.

🙏 Acknowledgements

Thanks to the community for support and inspiration. Special thanks to the maintainers of python-docx and beautifulsoup4.

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

super_tiny2docx-0.1.3.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

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

super_tiny2docx-0.1.3-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file super_tiny2docx-0.1.3.tar.gz.

File metadata

  • Download URL: super_tiny2docx-0.1.3.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for super_tiny2docx-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c3dd7cfc19db29046b1e7a81bc56311be4122eab27578e8d186eba10758acf05
MD5 467d02af89fdd450eb7169ed58880060
BLAKE2b-256 fffca82b8174e03acd242ca4f2bdde0f8deb1cd840a3e3e2f442d2c74e70cfb6

See more details on using hashes here.

File details

Details for the file super_tiny2docx-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for super_tiny2docx-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bf29099703cc54eb7d83945f6cfa5cd87d9f09ced6131273f3084127d1f5d17d
MD5 c95ee2dd4a8cb4a39c1103a624eae97f
BLAKE2b-256 4231d7ed1cf5438bee2e9c17e575523007289afa5b2088c55aa4d7ae3c616e16

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