def drawGroup(self, group): from svglib.document import Layer if isinstance(group, Layer): canvas = getattr(self, '_canvas', None) elements = [] for node in group.getContents(): elements.append(node) frame = Frame(0, 0, self._drawing.width, self._drawing.height, id=str(uuid.uuid4())) frame.id = 'TestLayer' frame.addFromList(elements, canvas) else: return super().drawGroup(group)