mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
extracting bills
This commit is contained in:
parent
b4296db52d
commit
32b053e7db
1 changed files with 12 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue