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/benouinirachid/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")

CLI Usage

You can also use the command-line interface to convert files:

svg2pptx input.svg output.pptx [options]

Options

Option Description
--no-text Skip converting text elements
--no-shapes Skip converting shape elements
--scale <float> Scale factor for the SVG content (default: 1.0)
--flatten Flatten groups into individual shapes (default)
--no-flatten Preserve group structure from SVG

Examples

# Basic conversion
svg2pptx diagram.svg presentation.pptx

# Scale up by 2x and skip text
svg2pptx chart.svg slide.pptx --scale 2.0 --no-text

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.3.tar.gz (196.7 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.3-py3-none-any.whl (32.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: svg2pptx-1.0.3.tar.gz
  • Upload date:
  • Size: 196.7 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.3.tar.gz
Algorithm Hash digest
SHA256 2921c4a83d8c21b4967824ab7f8d4babd5fdc81b497dea658bf0710704ab19f7
MD5 85ccdfb1d2c54504e112b76668a525c7
BLAKE2b-256 4a00f55ef9c47cdd4b4b79d41c2a866737fdb0f2f1ccc809431903a2414cb3ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for svg2pptx-1.0.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: svg2pptx-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 32.0 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 825812458df078cf0d252f77c9966a682663f002cbe2e0464af64e47d446f971
MD5 1937251a267a424340696fe7eea8acf5
BLAKE2b-256 eec7120fce32692d773f83cf2d668b2c87fafa0ca373c1338374617318766f37

See more details on using hashes here.

Provenance

The following attestation bundles were made for svg2pptx-1.0.3-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