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)
|
||||
7
pyproject.toml
Normal file
7
pyproject.toml
Normal file
@@ -0,0 +1,7 @@
|
||||
[project]
|
||||
name = "allmende_solimieten"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"pandas[excel]",
|
||||
]
|
||||
requires-python = ">=3.12"
|
||||
1
src/rent_data.json
Normal file
1
src/rent_data.json
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user