Skip to content

Instantly share code, notes, and snippets.

@vaporstack
vaporstack / strip_border.py
Created September 5, 2018 19:57 — forked from thobbs/strip_border.py
Strip the border from an SVG for plotting through Inkscape
import sys
import lxml.etree as le
def main(filename):
with open(filename, 'r+b') as f:
doc = le.parse(f)
# strip border strokes
for elem in doc.xpath('//*[attribute::style]'):
if 'stroke:none' in elem.attrib['style']: