mirror of
https://github.com/Hestia-Homes/survey-extraction.git
synced 2026-06-08 11:17:29 +00:00
access and elevation
This commit is contained in:
parent
bb878cd6c8
commit
c3f1a15993
2 changed files with 9 additions and 6 deletions
|
|
@ -57,17 +57,19 @@ def serialize_model(model: Any):
|
|||
else:
|
||||
return model
|
||||
|
||||
def make_final_json(rooms_obj, heating_system_obj, occupant):
|
||||
def make_final_json(rooms_obj, heating_system_obj, occupant, access_and_elevations):
|
||||
# Convert to dict recursively
|
||||
rooms_data = serialize_model(rooms_obj)
|
||||
heating_data = serialize_model(heating_system_obj)
|
||||
occupant_data = serialize_model(occupant)
|
||||
access_and_elevations_data = serialize_model(access_and_elevations)
|
||||
|
||||
# Combine into one big JSON-ready dict
|
||||
final_data = {
|
||||
"rooms": rooms_data,
|
||||
"heating_system": heating_data,
|
||||
"occupant_info": occupant_data,
|
||||
"access_and_elevations": access_and_elevations_data,
|
||||
}
|
||||
|
||||
# Convert to pretty JSON string
|
||||
|
|
@ -211,7 +213,8 @@ def handler(event, context):
|
|||
json_ = make_final_json(
|
||||
obj.master_obj[0],
|
||||
obj.master_obj[1],
|
||||
obj.master_obj[2]
|
||||
obj.master_obj[2],
|
||||
obj.master_obj[3],
|
||||
)
|
||||
print("Extracted completed, made json")
|
||||
|
||||
|
|
|
|||
|
|
@ -105,19 +105,19 @@ class WarmHomesConditionReport(SiteNotesExtractor):
|
|||
def __init__(self, data_list):
|
||||
super().__init__(data_list)
|
||||
self.type = ReportType.WARM_HOMES_CONDITION_REPORT
|
||||
room, heating_system, occupant = self.setup_condition_report()
|
||||
room, heating_system, occupant, access_and_elevation = self.setup_condition_report()
|
||||
|
||||
self.master_obj = room, heating_system, occupant
|
||||
self.master_obj = room, heating_system, occupant, access_and_elevation
|
||||
|
||||
def setup_condition_report(self):
|
||||
# general_information = self.get_section_1()
|
||||
# access_and_elevations = self.get_section_2()
|
||||
access_and_elevations = self.get_section_2()
|
||||
rooms = self.get_section_3()
|
||||
heating_system = self.get_section_4()
|
||||
occupant_assessment = self.get_section_5()
|
||||
# site_name, reference_code, address, postcode = self.get_section_0()
|
||||
|
||||
return rooms, heating_system, occupant_assessment
|
||||
return rooms, heating_system, occupant_assessment, access_and_elevations
|
||||
|
||||
def get_section_0(self):
|
||||
data = self.get_data_between("Project Site Name", "1. General Information")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue