Module to read svg

Stefan Behnel stefan.behnel-n05pAM at web.de
Mon Jan 8 10:10:09 EST 2007


schpok at gmail.com wrote:
> I'm looking for a module to load an SVG document so that I can read out
> its contents in some graphics-centric way. For example, path elements
> store their vertices in a long attribute string you need to parse. An
> ideal module would get me these vertices in a list.
> 
> SVGdraw seems to only write, but not read.
> 
> I'm interested in a pretty simple subset of the actual spec, where SVG
> Tiny is sufficient. W3C's python spec seems just what I want:
> http://www.w3.org/TR/SVGMobile12/python-binding.html
> 
> Does anyone know if there's an actual free implementation of this?
> Before I start salvaging out code from Skencil, is there anything else
> I might look at?

Check out XIST, it seems to have some kind of SVG support.

http://www.livinglogic.de/Python/xist/
http://mail.python.org/pipermail/xml-sig/2004-June/010325.html

In case you still end up wanting to write something yourself, you might
consider lxml's namespace implementation feature a good starting point.

http://codespeak.net/lxml/element_classes.html

Stefan



More information about the Python-list mailing list