fixed new bug In added

This commit is contained in:
Khalim Conn-Kowlessar 2024-08-27 14:48:40 +01:00
parent 4c71342cfb
commit 2890ff13cd
2 changed files with 12 additions and 3 deletions

View file

@ -329,10 +329,12 @@ class SearchEpc:
best_match = process.extractOne(
address, [", ".join([r["address"], r["posttown"]]) for r in rows], score_cutoff=0
)
# Get all of the scores
rows_filtered = [r for r in rows if ", ".join([r["address"], r["posttown"]]) == best_match[0]]
else:
best_match = process.extractOne(address, [r["address"] for r in rows], score_cutoff=0)
# Get all of the scores
rows_filtered = [r for r in rows if r["address"] == best_match[0]]
# Get all of the scores
rows_filtered = [r for r in rows if r["address"] == best_match[0]]
if rows_filtered:
return rows_filtered

View file

@ -89,6 +89,13 @@ def main():
address1 = address.split(",")[0]
asset_type_map = {
"HOUSE": "House",
"BUNGALOWS": "Bungalow",
"FLATS": "Flat",
"MAISONETTES": "Maisonette",
}
searcher = SearchEpc(
address1=address1,
postcode=home["Address - Postcode"],
@ -96,7 +103,7 @@ def main():
os_api_key="",
full_address=address,
)
searcher.ordnance_survey_client.property_type = None
searcher.ordnance_survey_client.property_type = asset_type_map[home["Asset Type"]]
searcher.ordnance_survey_client.built_form = None
searcher.find_property(skip_os=True)