python
Run complex scripts to customize Inkscape documents. Use code to programmatically control elements, styles, and geometry directly on the live SVG canvas.
Instructions
Run Python (inkex) against the live document in one undoable step — anything the other tools
cannot express. In scope: svg (root element), by_id(id), selected (ids), inkex, etree, Transform,
frames (frames.content(el) maps an element's coordinates to page px), to_px('3mm'), qname('inkscape:label'),
unique_id(base), parse_style/style_str. print() output and result = … come back. readonly=True
skips the document reload (fast inspection). timeout_s: give up waiting after this long (the
result is then UNCERTAIN COMPLETION: the code may still finish and apply).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| readonly | No | ||
| timeout_s | No | ||
| expected_revision | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |