skillfed

svgutils

Python SVG editor

svgutils v0.3.4 85.2K downloads/30d#13,940 on PyPI336
Permissive license Active released

What it is and what it does

svgutils is a Python library for programmatic SVG editing, designed primarily for scientists preparing publication-ready figures. It lets you load SVG files, scale and position them arbitrarily, add text labels and markers, and combine multiple SVGs into a single output. The package wraps lxml to handle the underlying XML manipulation, so you work with SVG elements and coordinates rather than raw XML.

Typical use involves loading one or more SVG files, arranging them on a canvas with specific dimensions and offsets, annotating them with labels or other markers, and saving the result. It's aimed at automating the tedious manual work of figure assembly in tools like Inkscape, particularly when you have many similar figures to prepare for journal submission.

Use it for:

  • Combine multiple scientific plots (e.g., from matplotlib) into a single multi-panel figure with consistent layout.
  • Automatically add panel labels (A, B, C) and scale bars to a set of SVG figures for publication.
  • Programmatically position and scale diagram elements without opening a GUI editor.
  • Generate reproducible figure layouts as part of a data analysis pipeline or Jupyter notebook.
  • Batch-process SVG files to apply consistent transformations (scaling, positioning) across many figures.

Worth the install?

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

svgutils lets you programmatically edit, scale, position, and concatenate SVG files, with support for adding labels and markers to figures.

Yes, if you need to automate SVG figure assembly for scientific publications. The package is actively maintained, has low install friction, and solves a real problem for researchers. However, be aware that the latest release is from 2021 and Python version support is unclear—test it with your target Python version before relying on it in production pipelines.

Install

svgutils on PyPI

pip

pip install svgutils

uv

uv add svgutils

poetry

poetry add svgutils

Installing svgutils

Before you install

Installation is straightforward via pip, but requires system development libraries for lxml (libxml2-dev and libxslt-dev on Debian-based systems). The package is actively maintained with recent commits.

License in practice

Distributed under the MIT license, which is permissive and imposes no restrictions on use, modification, or distribution in your own projects.

Quickstart

pip install svgutils

from svgutils.svg import SVG

fig = SVG('input.svg')
fig.scale(2.0)
fig.save('output.svg')

Requires system development libraries libxml2-dev and libxslt-dev (or equivalent) for lxml compilation on Linux; conda installation avoids this requirement.

Verify before relying

  • Whether the package works reliably with modern Python versions beyond those listed in classifiers (2.7, 3.5)
  • Current state of the codebase given the 2011-day gap between first and latest release
  • Whether all documented features from the blog post and readthedocs are fully functional in version 0.3.4

Package facts

License not declared (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — lxml
Maintenance actively maintained — 2,011 days since the last release
Last repo commit
First released
Downloads 85,227/month — #13,940 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: svgutils-0.3.4-py3-none-any.whl

Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.5Topic :: Multimedia :: Graphics :: Editors :: Vector-BasedTopic :: Scientific/Engineering :: VisualizationTopic :: Text Processing :: Markup

Tags

svg editor pythonsvg manipulation librarycombine svg filessvg scaling and positioningsvg figure annotationscientific figure preparationsvg concatenation
scientific-computingfigure-generationbatch-processing

More Markup packages