Skip to content

Instantly share code, notes, and snippets.

View davidnjohnson's full-sized avatar

davidnjohnson

View GitHub Profile
@Arkhangel
Arkhangel / suds_to_json.py
Last active April 3, 2020 20:25 — forked from robcowie/suds_to_json.py
Serialising Suds objects to json (Python3)
from suds.sudsobject import asdict
def recursive_asdict(d):
"""Convert Suds object into serializable format."""
out = {}
for k, v in asdict(d).items():
if hasattr(v, '__keylist__'):
out[k] = recursive_asdict(v)
elif isinstance(v, list):
out[k] = []