Skip to main content

Convert SVG files to native, editable PowerPoint shapes

Project description

SVG to PowerPoint Shape Converter

A Python library that converts SVG (Scalable Vector Graphics) files into native, editable PowerPoint shapes. Unlike simple image embedding, this tool parses SVG elements and recreates them as true PowerPoint objects—rectangles become rectangles, lines become lines, and text becomes editable text boxes.

Installation

pip install svg2pptx

Or install from source:

git clone https://github.com/svg2pptx/svg2pptx.git
cd svg2pptx
pip install -e ".[dev]"

Quick Start

from svg2pptx import svg_to_pptx

# Convert SVG file to PowerPoint
svg_to_pptx("icon.svg", "output.pptx")

Features

  • Editable shapes — Resize, recolor, and modify individual elements directly in PowerPoint
  • Native formatting — Apply PowerPoint styles, themes, and animations to converted shapes
  • Smaller file sizes — Vector shapes are lighter than embedded raster images
  • Preservation of structure — Maintain layers, groups, and object hierarchy from your original design

Supported SVG Elements

Element Support
<rect> ✅ Full
<circle> ✅ Full
<ellipse> ✅ Full
<line> ✅ Full
<polygon> ✅ Full
<polyline> ✅ Full
<path> ✅ Approximated curves
<g> (groups) ✅ Full
<text> ✅ Basic

Configuration

from svg2pptx import svg_to_pptx, Config

config = Config(
    scale=2.0,                  # Scale factor for SVG content
    curve_tolerance=0.5,        # Curve approximation quality (lower = more accurate)
    preserve_groups=True,       # Maintain SVG group structure
)

svg_to_pptx("diagram.svg", "output.pptx", config=config)

Advanced Usage

from svg2pptx import SVGConverter
from pptx import Presentation

# Add SVG shapes to an existing presentation
prs = Presentation()
slide = prs.slides.add_slide(prs.slide_layouts[6])  # Blank layout

converter = SVGConverter()
converter.add_to_slide("icon.svg", slide)

prs.save("combined.pptx")

Limitations

  • Bezier curves are approximated with line segments (configurable tolerance)
  • Gradients are not supported (will use first color)
  • Filters and effects (blur, drop shadow) are not supported
  • CSS external stylesheets are not supported

License

MIT License

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

svg2pptx-1.0.0.tar.gz (195.3 kB view details)

Uploaded Source

Built Distribution

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

svg2pptx-1.0.0-py3-none-any.whl (30.7 kB view details)

Uploaded Python 3

File details

Details for the file svg2pptx-1.0.0.tar.gz.

File metadata

  • Download URL: svg2pptx-1.0.0.tar.gz
  • Upload date:
  • Size: 195.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for svg2pptx-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6595d33db0a67fcf729d149047f4bc717edcf0534a2b5482ebd89f3e952dd665
MD5 92ed4696a567c92a1b823fa9971718d3
BLAKE2b-256 6d7a93983e8ab26e65a5b6d1679c02181acad4bbe0e146a115a64288b7e1bbf6

See more details on using hashes here.

Provenance

The following attestation bundles were made for svg2pptx-1.0.0.tar.gz:

Publisher: publish.yml on benouinirachid/svg2pptx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file svg2pptx-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: svg2pptx-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 30.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for svg2pptx-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 15f47bd07a49835519faa781ca006a528adfde985a69bc8ca80764e6cb7caa8f
MD5 84af4d03df075280ac10ecf2f2762812
BLAKE2b-256 f5809c9e2d7c23cb5375394def9d3625d386b5c455817884a2ff11750bd74a91

See more details on using hashes here.

Provenance

The following attestation bundles were made for svg2pptx-1.0.0-py3-none-any.whl:

Publisher: publish.yml on benouinirachid/svg2pptx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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