API Help

Erik python at lucidity.plus.com
Wed Jun 14 16:47:03 EDT 2017


On 14/06/17 21:38, Chris Angelico wrote:
> On Thu, Jun 15, 2017 at 6:33 AM, Bradley Cooper
> <brad at midwestaftermarket.com> wrote:
>> I am working with an API and I get a return response in this format.
>>
>>
>> [{"itemNumber":"75-5044","inventory":[{"warehouseCode":"UT-1-US","quantityAvailable":0.0000000000000},{"warehouseCode":"KY-1-US","quantityAvailable":0.0000000000000},{"warehouseCode":"TX-1-US","quantityAvailable":14.0000000000000},{"warehouseCode":"CA-1-US","quantityAvailable":4.0000000000000},{"warehouseCode":"AB-1-CA","quantityAvailable":1.0000000000000},{"warehouseCode":"WA-1-US","quantityAvailable":0.0000000000000},{"warehouseCode":"PO-1-CA","quantityAvailable":0.0000000000000}]}]
>>
>> What is the best way to read through the data?
> 
> That looks like JSON.

If the keys weren't quoted, I'd agree with you.

It looks like a REPL representation of a Python structure to me (list of 
dicts where the values could also be lists of dicts ...

What makes it look like JSON to you? (I'm not arguing, I'm asking what 
I've missed).

E.



More information about the Python-list mailing list