Skip to content
petercollingridge edited this page Feb 1, 2012 · 5 revisions

Requires Python 2.7

Example of use:

from cleanSVG import CleanSVG

svg = CleanSVG("test.svg")      # Read file test.svg

svg.removeAttributes('id')      # Remove all id attributes
svg.setDecimalPlaces(1)         # Round numbers to 1 decimal place
svg.extractStyles()             # Replace style attributes with CSS
svg.applyTransforms()           # Apply transform attributes to coordinates

svg.write("cleaned-test.svg")   # Output modified file test.svg
Clone this wiki locally