Read URP File in python


I wanted to know if there is a way to read a .urp file into python. I know the urp file is a form of compressed xml format, but I can’t seem to get the correct encoding to read it in python.

This library has a Python wrapper that allows you to edit the XML inside a URP file.

from underautomation.universal_robots.files.ur_program import URProgram

import clr


from System.Xml.Linq import XElement

prg = URProgram.load("path\\to\\program.urp")

xmlString = prg.xml.ToString()

## Edit xmlString

modifiedPrg = URProgram(XElement.Parse(xmlString))"path\\to\\program.urp")