Thanks for sharing!
I landed on something similar
def unwrap(object):
if str(object).startswith('<ArrayWrapper>'):
object = list(object)
object = [unwrap(item) for item in object]
elif str(object).startswith('<ObjectWrapper>'):
object = dict(object)
object = {key: unwrap(value) for key, value in object.items()}
return object
Would prefer to explicitly check for ArrayWrapper and ObjectWrapper types, but not having any luck.
<type 'com.inductiveautomation.perspective.gateway.script.PropertyTreeScriptWrapper$ArrayWrapper'>
<type 'com.inductiveautomation.perspective.gateway.script.PropertyTreeScriptWrapper$ObjectWrapper'>