Skip to main content

A Python library to create SVG drawings.

Project description



A Python library to create SVG drawings.

a simple example:

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'))

for more examples see:


with pip:

pip install svgwrite

or from source:

python install


Version 1.0.1 - 08.06.2012

  • added inline stylesheets
  • added examples created by Lawrence Tattrie

Version 1.0.0 - 27 May 2012

Version 0.2.4 - 30 December 2011

  • beta version
  • Python 2.7: all strings will be converted by the unicode() function, for strings containing none-ascii-characters use prefix u"" or better use from __future__ import unicode_literals, because this is Python 3 compatible.
  • tested with CPython 2.7, CPython 3.2, and PyPy 1.7
  • BUGFIX: color parsing accepts white spaces in rgb() like rgb(0, 0, 0)

Version 0.2.3 - 13 November 2010

  • beta version
  • Python 3.1 support
  • splitted into several files and moved them to the subdir ‘examples’

Version 0.2.2 - 05 November 2010

  • alpha version
  • removed ‘attribs’ parameter from all constructors
  • new elements: Set, Animate, AnimateMotion, AnimateColor, AnimateTransform, all filter elements
  • added set_desc(title, desc), set_metadata(xmldata) to BaseElement class
  • moved content of to, (ITransform -> Transform and so on)

Version 0.2.1 - 31 October 2010

  • alpha version
  • new elements: Marker, ClipPath, Mask
  • paint service: LinearGradient, RadialGradient, Pattern

Version 0.2.0 - 24 October 2010

  • alpha version
  • validator rewritten as
  • debug and profile options separated for each drawing object
  • important change: create objects with factory functions of the Drawing class: drawing.<svg-elementname>(…)
  • added mixins for setting stroke and fill properties
  • new elements: Hyperlink, Image, TextArea,

Version 0.1.0 - 26 September 2010

  • alpha version
  • new elements:
    • basic shapes: Line, Rect, Circle, Ellipse, Polyline, Polygon, Path
    • text elements: Text, TSpan, TRef, TextPath
    • container elements: Group, Symbol, SVG, Use, Defs
  • for examples see:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
svgwrite-1.0.1.tar.gz (183.9 kB) Copy SHA256 hash SHA256 Source None (237.8 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page