Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any scripting SVG editor?

I would like to edit SVG files using some scripting language (preferably Python). In particular, I would like to merge two SVG files, add some annotations, and arrange them in a larger image. Is there any software available for such purposes?

Thanks,

Bartosz

UPDATE

I finally decided to use the approach proposed by nosklo. You can find the code of SVG handling python module on github repo. I also described how to use it in this post

like image 589
btel Avatar asked Dec 10 '09 14:12

btel


3 Answers

You could use something like lxml - after all SVG files are XML. It's available from PyPI pip: https://pypi.python.org/pypi/lxml/

like image 70
nosklo Avatar answered Nov 18 '22 21:11

nosklo


I don't know if you could do what you describe, but Inkscape supports some degree of scripting with Python.

like image 36
Peter Hansen Avatar answered Nov 18 '22 22:11

Peter Hansen


Very late answer, but in case it helps anyone, I have written a very small extension for Inkscape that allows writing short python code snippets from within Inkscape.

You can type up to 5 lines and iterate over objects in the current selection or in an XPath. Includes some code examples.

like image 25
Sanjay Manohar Avatar answered Nov 18 '22 22:11

Sanjay Manohar