Compile Mermaid into editable native PowerPoint diagrams with python-pptx
Project description
diagram-pptx
Mermaid in. Editable PowerPoint shapes out.
diagram-pptx parses Mermaid into typed Python models and renders editable
PowerPoint AutoShapes, connectors, text, and groups. The same diagram can also
be exported to SVG, PNG, or JPEG.
Install
pip install diagram-pptx
For PNG and JPEG export:
pip install "diagram-pptx[image]"
Quick start
from pptx import Presentation
from diagram_pptx import render_mermaid
source = """
flowchart LR
request[Request] --> review{Approved?}
review -->|yes| publish[Publish]
review -->|no| request
"""
prs = Presentation()
slide = prs.slides.add_slide(prs.slide_layouts[6])
render_mermaid(source, slide=slide, position="full")
prs.save("diagram.pptx")
Native rendering is the default and needs no Node.js, PowerPoint, Docker, or LibreOffice. The resulting diagram is movable, resizable, ungroupable, and addressable by semantic ID.
from diagram_pptx import parse_mermaid
diagram = parse_mermaid(source)
diagram.model.nodes["publish"].label = "Release"
diagram.save("diagram.svg")
diagram.save("diagram.png", dpi=300)
Highlights
- All Mermaid 11.16 syntax families through Official geometry
- Typed models and Pure Python Native layout for flowchart, sequence, class, ER, and state
- Mutable typed models with parse/edit/compile workflows
- Editable native PowerPoint output through
python-pptx - Pure Python Native layout and optional Mermaid CLI Official geometry
- Themes, class/ID overrides, automatic text contrast, and color maps
- Inch bounds, named slide regions, and normalized
0..1placement - SVG plus optional high-resolution PNG/JPEG export
Documentation
- User guide · 日本語
- Mermaid compatibility · 日本語
- Architecture and extension contracts
- MCP and Codex integration
- Examples · 日本語
- Contributing
- Changelog
0.1.0b2 is a beta release. Unsupported Mermaid syntax is reported rather
than silently discarded. See the user guide for the support matrix and
backend behavior.
License
Project details
Release history Release notifications | RSS feed
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 diagram_pptx-0.1.0b2.tar.gz.
File metadata
- Download URL: diagram_pptx-0.1.0b2.tar.gz
- Upload date:
- Size: 2.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c2803dbf6fea0b5f5e3a4b7708afae44c239a7d5e5af22bf2ae9c55fd12065c
|
|
| MD5 |
82c420bdb2e52aa1c7fb128ba3cc0fe8
|
|
| BLAKE2b-256 |
89c72b68c5d41beb5a2da76702b2bdf3ce16011edd13324b27478545732a9177
|
Provenance
The following attestation bundles were made for diagram_pptx-0.1.0b2.tar.gz:
Publisher:
publish.yml on sci-gen/diagram-pptx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
diagram_pptx-0.1.0b2.tar.gz -
Subject digest:
2c2803dbf6fea0b5f5e3a4b7708afae44c239a7d5e5af22bf2ae9c55fd12065c - Sigstore transparency entry: 2256627404
- Sigstore integration time:
-
Permalink:
sci-gen/diagram-pptx@3e2062a39ab0645fe5a78bcb373217eaa28529f0 -
Branch / Tag:
refs/tags/v0.1.0b2 - Owner: https://github.com/sci-gen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3e2062a39ab0645fe5a78bcb373217eaa28529f0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file diagram_pptx-0.1.0b2-py3-none-any.whl.
File metadata
- Download URL: diagram_pptx-0.1.0b2-py3-none-any.whl
- Upload date:
- Size: 104.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8da660251f62b6842b20e40f00fdb9114c74116c375e310d25387212eca400a4
|
|
| MD5 |
2cfbeca63b707112890e70246e8ada59
|
|
| BLAKE2b-256 |
5b8456311fce93131e170648a55765979650622f549e1d8a4fdaee35e05d129e
|
Provenance
The following attestation bundles were made for diagram_pptx-0.1.0b2-py3-none-any.whl:
Publisher:
publish.yml on sci-gen/diagram-pptx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
diagram_pptx-0.1.0b2-py3-none-any.whl -
Subject digest:
8da660251f62b6842b20e40f00fdb9114c74116c375e310d25387212eca400a4 - Sigstore transparency entry: 2256627410
- Sigstore integration time:
-
Permalink:
sci-gen/diagram-pptx@3e2062a39ab0645fe5a78bcb373217eaa28529f0 -
Branch / Tag:
refs/tags/v0.1.0b2 - Owner: https://github.com/sci-gen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3e2062a39ab0645fe5a78bcb373217eaa28529f0 -
Trigger Event:
release
-
Statement type: