title: JSON list/dictionary parsing from API
body: <p>I have developed a small library and am interested in making it easier on users to retrieve data from the JSON lists/dictionaries that are returned. I have created functions that handle the calls using <em>requests</em>. Now suppose I call this function and pass in a few parameters:</p>
  
  <pre><code>precip = precipitation_obs(stid='kfnl', start='201504261800', end='201504271200', units='precip|in')
  </code></pre>
  
  <p>This will return the following JSON:</p>
  
  <pre><code>{ 'STATION': [ { 'ELEVATION': '5016',
                   'ID': '192',
                   'LATITUDE': '40.45',
                   'LONGITUDE': '-105.01667',
                   'MNET_ID': '1',
                   'NAME': 'Fort Collins/Loveland, Fort Collins-Loveland '
                           'Municipal Airport',
                   'OBSERVATIONS': { 'count_1': 6,
                                     'ob_end_time_1': '2015-04-27T00:55:00Z',
                                     'ob_start_time_1': '2015-04-26T18:55:00Z',
                                     'total_precip_value_1': 0.13,
                                     'vids case4': ['39', '51', '40', '52']},
                   'STATE': 'CO',
                   'STATUS': 'ACTIVE',
                   'STID': 'KFNL',
                   'TIMEZONE': 'US/Mountain'}],
    'SUMMARY': { 'METADATA_RESPONSE_TIME': '5.22613525391 ms',
                 'NUMBER_OF_OBJECTS': 1,
                 'RESPONSE_CODE': 1,
                 'RESPONSE_MESSAGE': 'OK',
                 'TOTAL_TIME': '57.6429367065 ms'}}    
  </code></pre>
  
  <p>Now, I want the user to be able to just drill down through the dictionary, but STATION is a list and requires me to do the following:</p>
  
  <pre><code>output =  precip['STATION'][0]['OBSERVATIONS']['ob_start_time_1'] 
  print(output)
  # returns 2015-04-26T18:55:00Z
  </code></pre>
  
  <p>where I have to include the [0] to avoid:</p>
  
  <pre><code>TypeError: list indices must be integers, not str
  </code></pre>
  
  <p>Is there anyway around this? Adding that [0] in there really jacks things up so to say. Or even having to specify ['STATION'] every time is a bit of a nuisance. Should I use the simpleJSON module to help here? Any tips on making this a bit easier would be great, thanks!</p>