Library for parsing SVG in Ruby or Python

SVG is a huge XML-based standard. I have parsed SVG as XML in the past. However, some things are complicated.

For example, I would like to know the size of the group. As far as I can tell, this is possible only by recursively moving through all the children in the group (noting all their transformations) and accumulating their sizes.

I would like to have a library that could do such things for me. Does something like this exist?

+6
source share
1 answer

In python you have pysvg :

import pysvg.parser svg = pysvg.parser.parse(<filename>) print svg.get_width(), svg.get_height() 
+6
source

Source: https://habr.com/ru/post/903906/


All Articles