Metadata-Version: 2.4
Name: diagram-pptx
Version: 0.1.0b1
Summary: Compile Mermaid into editable native PowerPoint diagrams with python-pptx
Project-URL: Homepage, https://github.com/sci-gen/diagram-pptx
Project-URL: Repository, https://github.com/sci-gen/diagram-pptx
Project-URL: Issues, https://github.com/sci-gen/diagram-pptx/issues
Project-URL: Changelog, https://github.com/sci-gen/diagram-pptx/blob/main/CHANGELOG.md
Author: diagram-pptx contributors
License-Expression: MIT
License-File: LICENSE
Keywords: diagram,flowchart,mermaid,powerpoint,pptx
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Office Suites
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: networkx<4,>=3.2
Requires-Dist: python-pptx<2,>=1.0.2
Provides-Extra: all
Requires-Dist: pillow<13,>=10; extra == 'all'
Requires-Dist: resvg-py<1,>=0.3; extra == 'all'
Provides-Extra: dev
Requires-Dist: build<2,>=1.2; extra == 'dev'
Requires-Dist: pillow<13,>=10; extra == 'dev'
Requires-Dist: pytest-cov<7,>=5; extra == 'dev'
Requires-Dist: pytest<9,>=8; extra == 'dev'
Requires-Dist: resvg-py<1,>=0.3; extra == 'dev'
Requires-Dist: ruff<1,>=0.6; extra == 'dev'
Requires-Dist: twine<7,>=5; extra == 'dev'
Provides-Extra: image
Requires-Dist: pillow<13,>=10; extra == 'image'
Requires-Dist: resvg-py<1,>=0.3; extra == 'image'
Description-Content-Type: text/markdown

<div align="right">
  <strong>English</strong> · <a href="https://github.com/sci-gen/diagram-pptx/blob/main/README.ja.md">日本語</a>
</div>

# diagram-pptx

**Mermaid in. Editable PowerPoint shapes out.**

[![CI](https://github.com/sci-gen/diagram-pptx/actions/workflows/ci.yml/badge.svg)](https://github.com/sci-gen/diagram-pptx/actions/workflows/ci.yml)
[![Python 3.10–3.13](https://img.shields.io/badge/python-3.10%E2%80%933.13-3776AB.svg)](https://www.python.org/)
[![MIT License](https://img.shields.io/badge/license-MIT-2EA44F.svg)](https://github.com/sci-gen/diagram-pptx/blob/main/LICENSE)
[![Package status](https://img.shields.io/badge/status-beta-2563EB.svg)](https://github.com/sci-gen/diagram-pptx/blob/main/CHANGELOG.md)

`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.

<p align="center">
  <img
    src="https://raw.githubusercontent.com/sci-gen/diagram-pptx/main/docs/assets/readme/diagram-pptx-gallery.png"
    alt="Flow, sequence, class, and state diagrams generated by diagram-pptx"
    width="100%"
  >
</p>

## Install

```bash
pip install diagram-pptx
```

For PNG and JPEG export:

```bash
pip install "diagram-pptx[image]"
```

## Quick start

```python
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.

```python
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..1` placement
- SVG plus optional high-resolution PNG/JPEG export

## Documentation

- [User guide](https://github.com/sci-gen/diagram-pptx/blob/main/docs/user-guide.md) · [日本語](https://github.com/sci-gen/diagram-pptx/blob/main/docs/user-guide.ja.md)
- [Mermaid compatibility](https://github.com/sci-gen/diagram-pptx/blob/main/docs/mermaid-compatibility.md) · [日本語](https://github.com/sci-gen/diagram-pptx/blob/main/docs/mermaid-compatibility.ja.md)
- [Architecture and extension contracts](https://github.com/sci-gen/diagram-pptx/blob/main/docs/architecture.md)
- [MCP and Codex integration](https://github.com/sci-gen/diagram-pptx/blob/main/docs/mcp-integration.md)
- [Examples](https://github.com/sci-gen/diagram-pptx/blob/main/examples/README.md) · [日本語](https://github.com/sci-gen/diagram-pptx/blob/main/examples/README.ja.md)
- [Contributing](https://github.com/sci-gen/diagram-pptx/blob/main/CONTRIBUTING.md)
- [Changelog](https://github.com/sci-gen/diagram-pptx/blob/main/CHANGELOG.md)

`0.1.0b1` 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

[MIT](https://github.com/sci-gen/diagram-pptx/blob/main/LICENSE)
