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.2.tar.gz (196.0 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.2-py3-none-any.whl (31.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: svg2pptx-1.0.2.tar.gz
  • Upload date:
  • Size: 196.0 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.2.tar.gz
Algorithm Hash digest
SHA256 6cbea55237a119863d5bdabb426d04e1fcf3d39589d962c485ce15d2933f5576
MD5 3ba7d6122d4f47a7c0d7ac05854ab03f
BLAKE2b-256 b3bb5d757201116b4de8edd7799db743f022668b55586fc81dfc54b8e35f31a6

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: svg2pptx-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 31.2 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 330ffab58fe0f0e27deb93312c891e547ef4fd3cfc246c0d0585119f9eebaa21
MD5 e60de07b42d03abfb0f2b0b9c3010bf4
BLAKE2b-256 f87b5cc82e4ad6ae0f8d6493820a9e8795ec38929fdbda8b65fd9f9fb84ab5b3

See more details on using hashes here.

Provenance

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