# Convert Param Object to PyDictionary

**URL:** <https://forum.inductiveautomation.com/t/convert-param-object-to-pydictionary/67590>\
**Category:** Ignition\
**Tags:** scripting, perspective\
**Created:** [December 14, 2022, 3:46am UTC](https://forum.inductiveautomation.com/t/convert-param-object-to-pydictionary/67590 "2022-12-14T03:46:06Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [December 14, 2022, 10:20pm UTC](https://forum.inductiveautomation.com/t/convert-param-object-to-pydictionary/67590/5 "2022-12-14T22:20:14Z")

</div>

Actually, if you're going that way I kinda prefer @justin.brzozoski's duck-typing approach:

> [@Function to convert json string or python dict into ObjectWrapper](https://forum.inductiveautomation.com/t/function-to-convert-json-string-or-python-dict-into-objectwrapper/32861/16):
>
> Forcing each to the expected type while traversing makes a deep copy: def sanitize\_tree(element): if hasattr(element, '\_\_iter\_\_'): if hasattr(element, 'keys'): return dict((k, sanitize\_tree(element[k])) for k in element.keys()) else: return list(sanitize\_tree(x) for x in element) return element EDIT: Got rid of the unnecessary zip() and used only one keys() iterator instead of two.

---

_[View the full topic](https://forum.inductiveautomation.com/t/convert-param-object-to-pydictionary/67590)._
