Is there any scripting SVG editor?

2019-04-25 08:40发布

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

3条回答
唯我独甜
2楼-- · 2019-04-25 08:43

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

*  http://www.smanohar.com/inkscape.php

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

查看更多
smile是对你的礼貌
3楼-- · 2019-04-25 08:51

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

查看更多
叛逆
4楼-- · 2019-04-25 09:04

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

查看更多
登录 后发表回答