skillfed

svgwrite

A Python library to create SVG drawings.

svgwrite v1.4.3 2.4M downloads/30d#3,081 on PyPI578
Permissive license MIT License Abandoned released

What it is and what it does

svgwrite is a pure Python library for programmatically creating and writing SVG files. You instantiate a Drawing object, add SVG elements (lines, circles, text, paths, groups, etc.) via method calls, and save the result to an XML file. The library handles element construction, attribute validation, and XML serialization internally, with support for multiple SVG profiles and features like gradients, markers, animations, stylesheets, and embedded fonts.

The package has no external runtime dependencies and runs on any platform supporting Python 3.6+. However, it is now abandoned: as of version 1.4.2, no new features are being added and only bugfixes are merged. The repository is archived and the last release was 2022-07-14. This makes it suitable for stable use cases where the existing feature set is sufficient, but unsuitable for projects requiring active development or responsive maintainers.

Use it for:

  • Generate static SVG diagrams or charts from data without manual XML editing.
  • Create vector graphics programmatically in automated workflows or batch processing.
  • Build SVG animations and interactive graphics with embedded stylesheets and fonts.
  • Export visualizations from Python applications as scalable vector files.
  • Construct complex SVG structures via Python API calls without writing raw XML.

Worth the install?

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

Creates SVG drawings programmatically by building XML elements and writing them to files.

Yes, if your use case fits the existing feature set and you do not require active maintenance. The library is stable, has no dependencies, and works reliably for core SVG generation. No, if you need ongoing feature development, responsive bug fixes, or active community support—the project is archived. Evaluate whether the 1.4.3 feature set meets your needs before committing.

Install

svgwrite on PyPI

pip

pip install svgwrite

uv

uv add svgwrite

poetry

poetry add svgwrite

Installing svgwrite

Before you install

Installation is straightforward with no runtime dependencies. However, the package is abandoned as of version 1.4.2 and explicitly states no new features will be added—only bugfixes will be merged. Last release was 2022-07-14 and the repository is archived.

License in practice

Licensed under MIT License (permissive), which allows commercial and private use with minimal restrictions.

Quickstart

pip install svgwrite

import svgwrite

dwg = svgwrite.Drawing('test.svg', profile='tiny')
dwg.add(dwg.line((0, 0), (10, 0), stroke=svgwrite.rgb(10, 10, 16, '%')))
dwg.add(dwg.text('Test', insert=(0, 0.2), fill='red'))
dwg.save()

Requires Python 3.6 or later; Python 2 support was removed in version 1.4.

Verify before relying

  • Whether the abandoned status and lack of active maintenance poses a risk for long-term production use.
  • Whether any SVG reading or import capability exists despite design intent to create-only.

Package facts

License MIT License (permissive)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance abandoned — 1,492 days since the last release
Last repo commit (repository archived)
First released
Downloads 2,399,791/month — #3,081 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: svgwrite-1.4.3-py3-none-any.whl

Development Status :: 7 - InactiveIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Multimedia :: GraphicsTopic :: Software Development :: Libraries :: Python Modules

Tags

svg generation pythoncreate svg drawingssvg drawing libraryprogrammatic svg creationsvg file writervector graphics pythonsvg elements builder
svg-generationgraphics-outputabandoned-but-stable

More Python Modules packages