diff --git a/survey_report/extraction/quidos.py b/survey_report/extraction/quidos.py index f11ffcb1..ae66dd0d 100644 --- a/survey_report/extraction/quidos.py +++ b/survey_report/extraction/quidos.py @@ -89,11 +89,23 @@ class SiteNotesExtractor: "heat_loss_area": sum([part["Heat Loss Area (m2)"] for part in building_parts]), } + def extract_bills_estimate(self): + """ + Extracts the estimated annual energy costs (£) from the report. + """ + pattern = re.search(r"Current annual energy costs £\s*([\d,.]+)", self.text) + + if not pattern: + raise ValueError("No bills estimate found in the report") + + self.data["Estimated Annual Energy Cost (£)"] = float(pattern.group(1).replace(",", "")) + def extract_all(self): """ Runs all extraction methods and returns a dictionary with extracted data. """ self.extract_sap_rating() self.extract_carbon_emissions() + self.extract_bills_estimate() self.extract_building_dimensions() return self.data