I am creating a set of SVG files that contain an unsuccessful amount of hard-coded values ββ(they should print with some elements the size of mm, while others should be scaled as a percentage, and most values ββare defined relative to each Other). Instead of manually managing these numbers (God forbid, I want to change something), I thought I could use my reliable python hammer to complete this task.
SVG 1.1 does not support any kind of variable scheme that would allow me to do what I want, and I am not interested in introducing javascript or unstable w3c draft specifications into the mix. One obvious solution is to use line formatting to read, parse, and replace variables in my SVG file. This seems like a bad idea for a larger document, but has the advantage of being simple and portable.
My second though was to research the available python-> svg libraries. Unfortunately, it seems that several options are usually either too new ( pySVG still has an unstable interface), too old (not updated) since 2005), or refused. I did not look carefully, but I believe that the charting applications are not flexible enough to create my documents.
The third option I came across is using another drawing tool (like cairo) that can be sure that it will send svg. This has a (potential) drawback, as it does not support the absolute sizes of the elements, which are so important to me, but may include the ability to output PDF, which would be convenient.
I already did a search on Google, so I'm looking for information from people who have used any of the above methods, or who might know about some other approach. For me, the long-term stability of any solution is important (this was the original reason for manual encoding, and not just the use of illustrator).
At this point, I'm leaning towards the first solution, so best practice guidelines for using python for parsing and replacing variables in XML files are welcome.