Skip to main content

Convert draw.io (diagrams.net) files to PowerPoint (.pptx) format - mxGraph to PresentationML converter

Project description

drawio2pptx

License: MIT PyPI - Python Version PyPi Version

Convert your draw.io diagrams to PowerPoint presentations! 🎨➡️📊

📖 Overview

drawio2pptx is a Python package that converts draw.io (diagrams.net) files to PowerPoint (.pptx) presentations. It performs conversion from mxGraph (the underlying format used by draw.io) to PresentationML (the XML format used by PowerPoint).

Important: One draw.io file corresponds to one PowerPoint presentation. Each page/diagram within the draw.io file becomes a separate slide in the resulting PowerPoint presentation.


✨ Features

🔧 Core Functionality

  • ✅ Convert draw.io files (.drawio, .xml) to PowerPoint (.pptx)
  • One file = One presentation: One draw.io file becomes one PowerPoint presentation
  • One page/diagram = One slide: Each page/diagram in a draw.io file becomes a separate slide
  • ✅ Support for multiple pages/diagrams in a single file
  • ✅ Automatic page size configuration (pageWidth, pageHeight)

🔷 Shape Support

  • Basic shapes: Rectangle, Square, Ellipse, Circle, Rounded Rectangle
  • Polygons: Triangle, Right Triangle, Hexagon, Octagon, Pentagon, Rhombus, Parallelogram, Trapezoid, Star (4/5/6/8-point)
  • 3D shapes: Cylinder
  • Flowchart shapes: Process, Decision, Document, Predefined Process, Internal Storage, Punched Tape, Stored Data, Cloud
  • Connectors/Edges: Straight lines, Orthogonal connectors with arrow support

🎨 Styling & Formatting

  • Colors: Hexadecimal (#RRGGBB), Short hex (#RGB), RGB format, light-dark format
  • Fill: Solid colors, gradients, transparent, default theme colors
  • Stroke: Color, width, styles (solid, dashed, dotted, dash-dot, dash-dot-dot)
  • Text: Font size, family, style (bold, italic, underline), alignment (horizontal/vertical), padding, wrapping
  • Effects: Shadow support, text background color (highlight)

📝 Text Support

  • Plain text and rich text (partial HTML format: font, b, i, u, strong, em tags)
  • Text line breaks
  • Font color extraction from style attributes and HTML tags

📊 Feature Status

This project is under active development. The core conversion functionality is working, and many basic shapes and styling features are supported.

For a detailed checklist of implemented and planned features, see FEATURES.md.


📦 Installation

Requirements

  • Python 3.8 or higher
  • python-pptx >= 0.6.21: Used for creating and writing PowerPoint (.pptx) files in PresentationML format
  • lxml >= 4.6.0: Used for parsing and processing XML/mxGraph data from draw.io files, and for directly editing PresentationML XML elements that are not supported by python-pptx (e.g., gradients, highlights, advanced styling)

Install Dependencies

pip install python-pptx lxml

Install as Package (Development Mode)

Install the package in development mode to use the drawio2pptx command:

pip install -e .

Or install from PyPI:

pip install drawio2pptx

🚀 Usage

Command Line Interface

After installation, use the drawio2pptx command:

drawio2pptx sample.drawio sample.pptx

Example

drawio2pptx sample.drawio sample.pptx

Alternative: Python Module

If the command is not found, you can run it as a Python module:

python -m drawio2pptx.main sample.drawio sample.pptx

Analysis Mode

You can use the --analyze (or -a) option to display analysis results after conversion:

drawio2pptx sample.drawio sample.pptx --analyze

📄 Sample files

The sample .drawio file included in this repository was created by the author for demonstration and testing purposes only.

It does not include any source code or assets from diagrams.net (draw.io). Any third-party icons used in the diagram remain the property of their respective owners.


🤝 Contributing

Bug reports and feature requests are welcome. Please open an issue on the repository.


📝 License

MIT License

See LICENSE file for details (or check pyproject.toml for license information).


👨‍💻 Author

mashu3

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

drawio2pptx-0.0.2.tar.gz (69.1 kB view details)

Uploaded Source

Built Distribution

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

drawio2pptx-0.0.2-py3-none-any.whl (52.3 kB view details)

Uploaded Python 3

File details

Details for the file drawio2pptx-0.0.2.tar.gz.

File metadata

  • Download URL: drawio2pptx-0.0.2.tar.gz
  • Upload date:
  • Size: 69.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for drawio2pptx-0.0.2.tar.gz
Algorithm Hash digest
SHA256 5a6d8a8ad9ba15a754f46c737279f64e0810ecaf9f02839b5677d20458d391be
MD5 099d8adc6c0209a2ac00bd20d5eed139
BLAKE2b-256 3bb4e33489e812b49f9cfa6494f49b76170681fb2771fbb91f59c4c348de03bf

See more details on using hashes here.

File details

Details for the file drawio2pptx-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: drawio2pptx-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 52.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for drawio2pptx-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 da89f1e476d2c36398740616d30bdc807b56a7f85ad55cfaff0a9eb01bfef03f
MD5 43a62df897a40d0b3565d793994380db
BLAKE2b-256 6ff2e5646b16abc9ac450f3a0120f7093c299f26791ada0dc8e503c6d8ab1859

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