skillfed

svgpathtools

A collection of tools for manipulating and analyzing SVG Path objects and Bezier curves.

svgpathtools v1.7.2 828.5K downloads/30d#4,954 on PyPI636
Permissive license MIT AGING released

What it is and what it does

svgpathtools is a Python library for working with SVG Path elements and Bézier curves at the geometric level. It lets you parse SVG files into Path objects composed of Line, Arc, QuadraticBezier, and CubicBezier segments, then manipulate and analyze them using mathematical operations. You can compute tangents, normals, curvature, arc length, intersections, bounding boxes, and areas; convert between Bézier and polynomial forms; and smooth or split paths.

The library depends on numpy for numerical operations, svgwrite for SVG output, and optionally scipy for performance. It's useful for programmatic SVG generation, geometric analysis of vector graphics, and path manipulation tasks that would be tedious to hand-code. Coordinates are represented as complex numbers, making geometric operations natural to express.

Use it for:

  • Parse an SVG file and compute geometric properties (arc length, curvature, bounding boxes) of its paths.
  • Programmatically generate or modify SVG paths by constructing Path objects and converting them to SVG d-strings.
  • Find intersections between SVG path segments or detect where paths cross each other.
  • Smooth kinked paths or break discontinuous paths into continuous subpaths for further processing.
  • Convert between SVG Bézier curves and polynomial representations for mathematical analysis or visualization.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Reads, writes, and analyzes SVG Path objects and Bézier curves, providing geometric tools to transform, intersect, and measure path elements.

Yes, if you need to work with SVG paths programmatically or perform geometric analysis on vector graphics. The library is stable (MIT, no known vulnerabilities), has low install friction, and supports modern Python. The aging maintenance status is not a blocker—the last commit is recent and the repository is active—but you should verify scipy's necessity for your use case and be aware that some functionality may not be fully tested on discontinuous paths.

Install

svgpathtools on PyPI

pip

pip install svgpathtools

uv

uv add svgpathtools

poetry

poetry add svgpathtools

Installing svgpathtools

Before you install

Low friction install with three runtime dependencies (numpy, svgwrite, scipy). The package is aging but actively maintained—last commit 2025-11-30, repository not archived, and supports current Python versions (3.8–3.13).

License in practice

MIT license (permissive) allows use in commercial and private projects with minimal restrictions; attribution required.

Quickstart

from svgpathtools import Path, CubicBezier, Line, parse_path
seg1 = CubicBezier(300+100j, 100+100j, 200+200j, 200+300j)
seg2 = Line(200+300j, 250+350j)
path = Path(seg1, seg2)
print(path.d())

Verify before relying

  • Whether scipy is truly optional or required for core functionality beyond performance optimization.
  • Extent of testing coverage for discontinuous Path objects (documentation notes some functionality untested on them).
  • Performance characteristics when handling large or complex SVG files.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 3 — numpy, svgwrite, scipy
Maintenance aging — 257 days since the last release
Last repo commit
First released
Downloads 828,505/month — #4,954 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: svgpathtools-1.7.2-py2.py3-none-any.whl

Keywords: svg, svg path, svg.path, bezier, parse svg path, display svg

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Multimedia :: Graphics :: Editors :: Vector-BasedTopic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Image RecognitionTopic :: Scientific/Engineering :: Information AnalysisTopic :: Scientific/Engineering :: MathematicsTopic :: Scientific/Engineering :: VisualizationTopic :: Software Development :: Libraries :: Python Modules

Tags

svg path manipulationbezier curve toolssvg parsing and editinggeometric path analysissvg to python objectscurve intersection detectionsvg path geometry
svg-graphicsbezier-curvesgeometry

More Scientific/Engineering packages