How would I call Inkscape functions from Python without loading the full Inkscape GUI? I'm aware Inkscape's Python extension feature, but I believe this assumes you've got Inkscape open and are running Python inside of it. I want to write a small Python script, that can create a simple path and perform Inkscape's Inset() or Simplify() path effects on it. Is that currently possible?
Regards,
Chris
Calling Inkscape Functions from Python
Re: Calling Inkscape Functions from Python
Cerin wrote:I want to write a small Python script, that can create a simple path and perform Inkscape's Inset() or Simplify() path effects on it. Is that currently possible?
By using verbs many of Inkscape's commands can be called from the command line (it still opens the GUI window, but does not require user interaction). Creating a path or shape however is not possible from the command line in current stable releases.
Example from the Inkscape man page:
Code: Select all
inkscape filename.svg --select=path1555 --verb=EditDuplicate --verb=ObjectRotate90 --verb=FileSave --verb=FileClose
The development branch has the new dbus scripting API merged (a GSoC project from 2009), but most likely it only works on linux at the moment. Unfortunately the documentation is not available online - I can only refer to discussions from 2009 on the inkscape-devel mailing list:
Subject: GSoC Idea: Inkscape API Improvement
Subject: Inkscape scripting API (Draft)