Endpoint für etl_property_neighbours hinzugefügt

main
mmaurostoffel 2025-01-09 14:48:33 +01:00
parent 258f1e4df6
commit cc71cbba2d
1 changed files with 6 additions and 0 deletions

View File

@ -3,6 +3,7 @@ import polars as pl
from data import etl_property_capacities as etl_pc
from data import etl_property_capacities_monthly as etl_pcm
from data import etl_property_capacities_weekdays as etl_pcw
from data import etl_property_neighbours as etl_pn
from data import etl_region_capacities as etl_rc
from data import etl_region_capacities_comparison as etl_rcc
from fastapi import FastAPI, Response
@ -35,6 +36,11 @@ def properties_growth():
def properties_geo():
return d.properties_geo().pl().to_dicts()
@app.get("/property/{id}/neighbours")
def property_extractions(id: int):
capacities = etl_pn.property_neighbours(id)
return capacities
@app.get("/property/{id}/extractions")
def property_extractions(id: int):
return d.extractions_for(property_id = id).pl().to_dicts()