if isinstance(new, dict):
tank.append((tank_value, start_of_refueling, end_of_refueling, key, [i['Serial'] for i in response]))
tank = []
response = request_2.json()
for key in response.keys():
new = response[key]
if isinstance(new, dict):
if 'Tank1FuelUpDnVol' in new['Params']:
index = new['Params'].index('Tank1FuelUpDnVol')
time = new['Params'].index('DateTimeFirst')
last_time = new['Params'].index('DateTimeLast')
value = new['Items']
if value[0]["Caption"] == 'Заправка':
tank_value = value[0]['Values'][index]
start_of_refueling = value[0]['Values'][time]
end_of_refueling = value[0]['Values'][last_time]
tank.append(tank_value)
df = pd.DataFrame({"tank_value": tank})
pprint(df)
response = request_2.json()
for key in response.keys():
new = response[key]
if isinstance(new, dict):
if 'Tank1FuelUpDnVol' in new['Params']:
index = new['Params'].index('Tank1FuelUpDnVol')
time = new['Params'].index('DateTimeFirst')
last_time = new['Params'].index('DateTimeLast')
value = new['Items']
if value[0]["Caption"] == 'Заправка':
tank_value = value[0]['Values'][index]
start_of_refueling = value[0]['Values'][time]
end_of_refueling = value[0]['Values'][last_time]
print(tank_value)
response = request_2.json()
for key in response.keys():
new = response[key]
if isinstance(new, dict):
if 'Tank1FuelUpDnVol' in new['Params']:
index = new['Params'].index('Tank1FuelUpDnVol')
value = new['Items']
pprint(value[0]['Values'][index])