I have some data coming from a SOAP API using Suds which I need to parse in my Python script. Before I go off and write a parser (ther
The right answer, as is often the case, is in the docs. The bits in (brackets) are objects which can contain other objects or types.
In this case we have an ArrayOfBalance object which contains a list of Balance types, each of which has the attributes of Amount and Currency.
These can all be referred to using . notation so the following one-liner does the trick.
balance = {item.Currency: item.Amount for item in response.Balance}