Add python script to export data from excel
This commit is contained in:
23
prepareFlatData.py
Normal file
23
prepareFlatData.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from pandas import read_excel
|
||||
import json
|
||||
|
||||
PATH = "/home/niklas/Nextcloud_Allmende/wohpro/04_AGs/04_AG_Finanzen/Finanzierungsplan MHS/2024-11-05_FP_Allmende_Umschuldung_Angebot Nachfinanzierung_Szenarien_Solimieten.xlsx"
|
||||
|
||||
OUTPUT_PATH = "./rent_data.json"
|
||||
|
||||
if __name__ == "__main__":
|
||||
df = read_excel(PATH, sheet_name="Solimieten Daten Onlinetool")
|
||||
|
||||
data = {}
|
||||
|
||||
for index, row in df.iterrows():
|
||||
data[row["Wohneinheit"]] = {
|
||||
"size_private": row["Zahlfläche privat (m²)"],
|
||||
"size_shared": row["Zahlfläche intern"],
|
||||
"min_rent": row["Mindestmiete"],
|
||||
"free_rent": row["Standardmiete frei"],
|
||||
"wbs_rent": row["Standardmiete WBS"],
|
||||
}
|
||||
|
||||
with open(OUTPUT_PATH, "w") as f:
|
||||
json.dump(data, f)
|
||||
Reference in New Issue
Block a user