sipro blueprint
This commit is contained in:
11
auxiliary.py
Normal file
11
auxiliary.py
Normal file
@@ -0,0 +1,11 @@
|
||||
def to_nested_dict(row):
|
||||
result = {}
|
||||
for key, value in row._mapping.items():
|
||||
keys = key.split('.')
|
||||
current_level = result
|
||||
for part in keys[:-1]:
|
||||
if part not in current_level:
|
||||
current_level[part] = {}
|
||||
current_level = current_level[part]
|
||||
current_level[keys[-1]] = value
|
||||
return result
|
||||
Reference in New Issue
Block a user