mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
fixed new bug In added
This commit is contained in:
parent
4c71342cfb
commit
2890ff13cd
2 changed files with 12 additions and 3 deletions
|
|
@ -329,10 +329,12 @@ class SearchEpc:
|
||||||
best_match = process.extractOne(
|
best_match = process.extractOne(
|
||||||
address, [", ".join([r["address"], r["posttown"]]) for r in rows], score_cutoff=0
|
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:
|
else:
|
||||||
best_match = process.extractOne(address, [r["address"] for r in rows], score_cutoff=0)
|
best_match = process.extractOne(address, [r["address"] for r in rows], score_cutoff=0)
|
||||||
# Get all of the scores
|
# Get all of the scores
|
||||||
rows_filtered = [r for r in rows if r["address"] == best_match[0]]
|
rows_filtered = [r for r in rows if r["address"] == best_match[0]]
|
||||||
|
|
||||||
if rows_filtered:
|
if rows_filtered:
|
||||||
return rows_filtered
|
return rows_filtered
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,13 @@ def main():
|
||||||
|
|
||||||
address1 = address.split(",")[0]
|
address1 = address.split(",")[0]
|
||||||
|
|
||||||
|
asset_type_map = {
|
||||||
|
"HOUSE": "House",
|
||||||
|
"BUNGALOWS": "Bungalow",
|
||||||
|
"FLATS": "Flat",
|
||||||
|
"MAISONETTES": "Maisonette",
|
||||||
|
}
|
||||||
|
|
||||||
searcher = SearchEpc(
|
searcher = SearchEpc(
|
||||||
address1=address1,
|
address1=address1,
|
||||||
postcode=home["Address - Postcode"],
|
postcode=home["Address - Postcode"],
|
||||||
|
|
@ -96,7 +103,7 @@ def main():
|
||||||
os_api_key="",
|
os_api_key="",
|
||||||
full_address=address,
|
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.ordnance_survey_client.built_form = None
|
||||||
|
|
||||||
searcher.find_property(skip_os=True)
|
searcher.find_property(skip_os=True)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue