SVG + CSV = IMG

Tags: python svg csv png

I pushed a new project up to github. It is called svgcsvimg, and it generates a series of PNG images from an SVG template and data provided in a CSV file.

I built this tool because I was too lazy to manually create intro slides for a series of videos. I made the slide template, put all of the video metadata into a csv file, and then spent two hours hacking out this little project. It’s true: I could have manually created all of those slides in that time, but then I wouldn’t have this code to give away.

My general rule of thumb is to do something manually once. If it comes up a second time, I will manually complete the task and write down the steps with an eye toward repeatable automation. Then I’m ready to write up code when that third time comes around. I had twenty slides to produce, so I jumped straight to step three for this project.

I used Inkscape to create the template, and the SVG rendering was done with a combination of Pycairo and RSVG.