Python SVG writer
2026, Feb 02
Today I learned that generating SVG files using python is fairly easy. SVG is just HTML for images, so I was not that surprised.
Feel free to read up on the details of SVG.
You import svgwrite, and start adding objects. I kept it simple. My goal was to create a template for cover images for my blog posts that I could then put into inkscape for the final tweaks.
That works.
Gotchas
-
Make sure you specify height and width of inline images, otherwise inkscape start to have issues importing svg
-
Add groupings. It is simple in python, and you’ll love it when you want to move objects around.