tags:

views:

134

answers:

2

I'm looking for a pure Python library to help put together SVG images. It doesn't need to be fast.

I know pySVG exists, but I'm not interested in a GPL library (and I can't use GPL libraries for this particular project).

Basic SVG elements aren't especially complicated, so I suppose I could roll my own, but I'd rather participate in an existing project than go off on my own.

Thanks!

+1  A: 

If your backend is OpenGL, I recommend Squirtle-SVG-Library that draws SVG images using pyglet.

grayger
I'd prefer not to have a pyglet dependency, but I agree that this satisfies my requirements, thanks!
Jeffrey Harris
+1  A: 

I wrote a library that I use to generate XHTML and SVG and I posted it here. It's pretty easy, each element has a corresponding all upper case class, the __init__ parameters are child elements and keyword parameters are attributes. The Transformable class, inherited by PATH and RECT, have additional functions for building attribute values.

Have fun with it, I'm posting this as free to use for anything you want, and if you make some improvements I would appreciate them. If there's more interest I'll make it a SourceForge or Google Code project.

[edit: remove the import of the DebugContents class and the _debugContents attribute in XML.py, that's part of a large debugging framework.]

Joel
That's exactly the sort of thing I was looking for, thanks! Now, would you be willing to put together a project page which lists the license and link to that page, rather than linking directly to a binary with no license information?
Jeffrey Harris