So I have the following JSON response that I get from a cloud database (this is a small part of it):
{'series': [{'name': 'G', 'type': 'c8y_g_ist', 'unit': ''},
{'name': 'T', 'type': 'c8y_t_rohr_ist', 'unit': 'C'},
{'name': 'P', 'type': 'c8y_ph_soll_ist', 'unit': 'ph'},
{'name': 'T', 'type': 'c8y_t_tank_ist', 'unit': 'C'},
{'name': 'V', 'type': 'c8y_v_rohr_ist', 'unit': 'm/s'},
{'name': 'Bio', 'type': 'c8y_NO3_Wert', 'unit': 'mg/l'},
{'name': 'T', 'type': 'c8y_t_rohrsurface_ist', 'unit': 'C'},
{'name': 'Bio', 'type': 'c8y_PO4_Wert', 'unit': 'mg/l'},
{'name': 'P', 'type': 'c8y_ph_ist', 'unit': 'ph'},
{'name': 'Bio', 'type': 'OD_Wert', 'unit': ''}],
'truncated': False,
'values': {'2018-03-15T00:00:17.000Z': [{'max': 92.78, 'min': 92.78},
{'max': 3.21, 'min': 3.21}],
'2018-03-15T00:05:18.000Z': [None, {'max': 3.2, 'min': 3.2}],
'2018-03-15T00:06:49.000Z': [{'max': 92.78, 'min': 92.78},
{'max': 3.2, 'min': 3.2},
{'max': 5, 'min': 5},
{'max': 3.64, 'min': 3.64},
{'max': 0, 'min': 0},
{'max': 0, 'min': 0},
{'max': 3.04, 'min': 3.04},
{'max': 0, 'min': 0},
{'max': 0, 'min': 0},
{'max': 0, 'min': 0}],
'2018-03-15T00:10:17.000Z': [{'max': 95.22, 'min': 95.22},
{'max': 3.14, 'min': 3.14},
None,
{'max': 3.57, 'min': 3.57},
{'max': 0.01, 'min': 0.01},
None,
{'max': 2.97, 'min': 2.97},
None,
None,
None],
'2018-03-15T00:15:17.000Z': [{'max': 92.78, 'min': 92.78},
{'max': 3.13, 'min': 3.13},
None,
None,
{'max': 0, 'min': 0},
None,
None,
None,
None,
None],
Now I can read a value, for example the 92.78 that is in this line:
'values': {'2018-03-15T00:00:17.000Z': [{'max': 92.78, 'min': 92.78},
With:
SingleValue = get_mint_json['values']['2018-03-15T00:00:17.000Z'][0]['max']
SingleValue = json.dumps(SingleValue)
pprint.pprint(SingleValue)
(here get_mint_json is what the JSON response is stored as) The response of this is as expected: '92.78'
Now my question: I want to do this for all the data points, so not only for 2018-03-15T00:00:17.000Z but also for 2018-03-15T00:05:18.000Z and 2018-03-15T00:06:49.000Z etc. How do I do that without having to hardcode all of these specific names?