On 2017-06-14, Erik <pyt...@lucidity.plus.com> wrote: > On 14/06/17 21:38, Chris Angelico wrote: >> On Thu, Jun 15, 2017 at 6:33 AM, Bradley Cooper >> <b...@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.
Yep. > If the keys weren't quoted, I'd agree with you. JSON keys _are_ quoted. > 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? The fact that it _is_ valid JSON (at least according to the parsers I've tried on it, both locally and using things like jsonlint.com). > (I'm not arguing, I'm asking what I've missed). -- Grant Edwards grant.b.edwards Yow! I request a weekend in at Havana with Phil Silvers! gmail.com -- https://mail.python.org/mailman/listinfo/python-list