Skip to main content

A Python library to create SVG drawings.

Project description

svgwrite

Abstract

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'))
dwg.save()

for more examples see: examples.py

Installation

with pip:

pip install svgwrite

or from source:

python setup.py install

Documentation

send feedback to mozman@gmx.at

svgwrite can be found on bitbucket.org at:

http://bitbucket.org/mozman/svgwrite

NEWS

Version 1.1.2 - 08 January 2013

  • prevent setup.py from compiling all modules - error with ‘pyparsing_py2.py’ and Python3

  • BUGFIX: all tests run with CPython3.3

Version 1.1.1 - 15 August 2012

  • License changed to MIT License

  • tested with CPython2.7, CPython3.2, CPython3.3 and pypy-1.9 on Win7 Pro 32-bit

  • BUGFIX: dwg.animateTranform() -> dwg.animateTransform()

  • BUGFIX: in examples, replaced width and height params by size parameter

  • added examples

  • edit docs

Version 1.0.1 - 08 June 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 examples.py 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 interfaces.py to mixins.py, (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 validator2.py

  • 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: examples.py

Project details


Download files

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

Source Distributions

svgwrite-1.1.2.zip (228.0 kB view details)

Uploaded Source

svgwrite-1.1.2.tar.gz (173.6 kB view details)

Uploaded Source

File details

Details for the file svgwrite-1.1.2.zip.

File metadata

  • Download URL: svgwrite-1.1.2.zip
  • Upload date:
  • Size: 228.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for svgwrite-1.1.2.zip
Algorithm Hash digest
SHA256 35b6bacd5eab49ccc7ea7733ecff55fd85d7d3cecf8a75a1414d26f4555b921b
MD5 10e43ec2a92173be51b75b53dd9422f6
BLAKE2b-256 73d71655d0005b680fb978bba8f0b8dad622b8449641263ac20b8ba0b12f15c2

See more details on using hashes here.

File details

Details for the file svgwrite-1.1.2.tar.gz.

File metadata

  • Download URL: svgwrite-1.1.2.tar.gz
  • Upload date:
  • Size: 173.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for svgwrite-1.1.2.tar.gz
Algorithm Hash digest
SHA256 cdb1732103381f6695fd6c86c91e1170ed8955b04acec6852fa33f9dc00dbe76
MD5 5ab1a40bad050ddeac526e4e4c70ba93
BLAKE2b-256 5937f7babeb8e2dbf09711a82d3098754798235e9562acfcdbd8f5c0c1ab63f1

See more details on using hashes here.

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