sipro blueprint

This commit is contained in:
2023-11-25 01:44:52 +03:00
parent 560a0248a5
commit 98a9a2cd61
4 changed files with 66 additions and 0 deletions

11
auxiliary.py Normal file
View 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