Elegant Solution for looping over a json hash with a fickle structure
<p>I have a json hash which has a lot of keys. I retrieve this hash from a web service at regular intervals and for different parameters etc. This has more or less fixed structure, in the sense that keys are sometimes missing.
So I end up with a lot of code of the following nature</p>

<p>Edit:
Sample <code>data</code></p>

<pre><code>data =
{
id1 : {dict...},
id2 : {dict..},
'' : {value...},
...
}

for item in data:
   id = data.get("id")
   if not id:
      continue
   ...
</code></pre>

<p>I want to skip the 3rd element and move on. The structure <code>data</code> is a nested <code>dict</code> and I loop inside each of these nests. There are keys missing there as well :(</p>

<p>I was wondering if there was a more elegant solution than having 50 different <code>if</code>s and <code>continue</code>s</p>

<p>Thanks</p>
