Convert draw.io (diagrams.net) files to PowerPoint (.pptx) format - mxGraph to PresentationML converter
Project description
drawio2pptx
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 files included in this repository were created by the author
for demonstration and testing purposes only.
They do not include any source code or assets from diagrams.net (draw.io). Any third-party icons used in the diagrams 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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file drawio2pptx-0.0.3.tar.gz.
File metadata
- Download URL: drawio2pptx-0.0.3.tar.gz
- Upload date:
- Size: 74.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3502aefb937f4c288ddc8b20734fd490c72a5d5a16bb63bc35bbc51310dcc29e
|
|
| MD5 |
04687457176bb071df2ae41a19167747
|
|
| BLAKE2b-256 |
4d3a5902bb69a19898f5c74fc3f82b4bf655ef75923de5229051cfed23ac6d19
|
File details
Details for the file drawio2pptx-0.0.3-py3-none-any.whl.
File metadata
- Download URL: drawio2pptx-0.0.3-py3-none-any.whl
- Upload date:
- Size: 57.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c11df12ad270f32a23aefa8812347b1e8b621db1c81d6ef6a1745b7848e4ca2
|
|
| MD5 |
9e0d342e5132074b5e594c20833c4460
|
|
| BLAKE2b-256 |
80dc3e954b48b708b85719d9b8c8ad040879250e50d4bd50e26cc47ccb11d87d
|