list_1 = ['15.09.2023 5:19:47',
'15.09.2023 5:22:31',
45.2100399,
45.2100399,
59.5555828,
59.5555828,
'15.09.2023 5:19:47',
'15.09.2023 5:22:31',
'00:02:44',
'00:00:00',
'00:02:44',
0.0,
'15.09.2023 5:19:47',
'15.09.2023 5:22:31',
None,
None,
1,
0.0,
None,
0,
"45° 12,60240' вд, 59° 33,33497' сш",
"45° 12,60240' вд, 59° 33,33497' сш",
'15.09.2023 5:19:47',
'15.09.2023 5:22:31',
179.9137931,
329.8245614,
149.9107683,
0.0,
1,
0,
149.9107683,
'00:02:44',
'00:02:44',
0.0,
None,
None]
list_2 = ['09.09.2023 6:35:18',
'09.09.2023 6:40:18',
37.1863528,
37.1863528,
59.3521012,
59.3521012,
'09.09.2023 6:35:18',
'09.09.2023 6:40:18',
'00:05:00',
'00:00:00',
'00:05:00',
0.0,
'09.09.2023 6:35:18',
'09.09.2023 6:40:18',
None,
None,
1,
0.0,
None,
0,
"37° 11,18117' вд, 59° 21,12607' сш",
"37° 11,18117' вд, 59° 21,12607' сш",
None,
None,
112.5641026,
210.0,
97.4358974,
0.0,
1,
0,
97.4358974,
'00:00:00',
'00:00:00',
0.0,
None,
None,
0.0]
with open('autodoor.xml', 'rb') as file:
var = xmltodict.parse(file)
df = pd.DataFrame(var)
keys = ['time', 'user_name', 'rfid_key', 'litre', 'type']
new_df = df['table']['fillings']['filling']
for i in new_df:
items = list(map(i.get, keys))
items.to_sql('benz', conntect, if_exists='replace')