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.1.tar.gz (195.9 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.1-py3-none-any.whl (30.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: svg2pptx-1.0.1.tar.gz
  • Upload date:
  • Size: 195.9 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.1.tar.gz
Algorithm Hash digest
SHA256 e25ee24decfd237169e06375bca1ef051fc7807cb14df3fff1b6b48fca198ae2
MD5 2f48329e7cb4adf9691eb55a3bc82e95
BLAKE2b-256 43b04e5e973712a785e486d1ed0481f1491ccda41067101f3b938c63c2dcc65e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: svg2pptx-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 30.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 70bf2fbc871449b9ff830bb88fdf116b037847fcba51b1c836510403c45cc211
MD5 0a1c8cce7c363ecdb24d4a95a66d431f
BLAKE2b-256 30df08a254fe09cc63b0ebe55be777a59e49661ac016d91476b7e4a4b42ba4ac

See more details on using hashes here.

Provenance

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