From 19ab0ad7574b076b01d47d516f4cab47695cb79c Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Fri, 6 Mar 2026 14:58:49 +0000 Subject: [PATCH] deleted the wrong folder aded back the origional --- .../OrdnanceSurvey.py | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) rename OrdnanceSurvey.py => backend/OrdnanceSurvey.py (86%) diff --git a/OrdnanceSurvey.py b/backend/OrdnanceSurvey.py similarity index 86% rename from OrdnanceSurvey.py rename to backend/OrdnanceSurvey.py index 1ae66152..a4d716d0 100644 --- a/OrdnanceSurvey.py +++ b/backend/OrdnanceSurvey.py @@ -90,21 +90,13 @@ class OrdnanceSuveyClient: self.results = results # Extract some details about the best match - self.most_relevant_result = ( - self.results[0]["DPA"] - if "DPA" in self.results[0] - else self.results[0]["LPI"] - ) + self.most_relevant_result = self.results[0]["DPA"] if "DPA" in self.results[0] else self.results[0]["LPI"] - self.parse_classification_code( - self.most_relevant_result["CLASSIFICATION_CODE"] - ) + self.parse_classification_code(self.most_relevant_result["CLASSIFICATION_CODE"]) self.set_places_address() else: - logger.info( - "Could not find any results for the provided address and postcode" - ) + logger.info("Could not find any results for the provided address and postcode") return {"status": response.status_code} @@ -124,11 +116,11 @@ class OrdnanceSuveyClient: value_map = { # In the OS api, "RD" is a "Dwelling" however this is not valid property type in the EPC database - "RD": {}, - "RD02": {"property_type": "House", "built_form": "Detached"}, - "RD03": {"property_type": "House", "built_form": "Semi-Detached"}, - "RD04": {"property_type": "House", "built_form": "Mid-Terrace"}, - "RD06": {"property_type": "Flat"}, + 'RD': {}, + 'RD02': {'property_type': 'House', 'built_form': 'Detached'}, + 'RD03': {'property_type': 'House', 'built_form': 'Semi-Detached'}, + 'RD04': {'property_type': 'House', 'built_form': 'Mid-Terrace'}, + 'RD06': {'property_type': 'Flat'}, } # Other classifications can be found in here: # https://osdatahub.os.uk/docs/places/technicalSpecification in the CLASSIFICATION_CODE description.