All good
This commit is contained in:
parent
6ea544a0f6
commit
6cc7288126
45 changed files with 929 additions and 1043 deletions
|
|
@ -76,7 +76,7 @@ def normalize_sub_type(sub_type: str | None) -> str:
|
|||
"""Normalize property sub-type for consistent storage.
|
||||
|
||||
Fixes delimiter inconsistencies (underscores/hyphens → spaces) from
|
||||
home.co.uk and truncates Zoopla description fragments that were
|
||||
legacy listing data and truncates Zoopla description fragments that were
|
||||
accidentally captured as sub-types.
|
||||
"""
|
||||
if not sub_type:
|
||||
|
|
@ -200,31 +200,13 @@ def transform_property(
|
|||
|
||||
price_obj = prop.get("price", {})
|
||||
amount = parse_int_value(price_obj.get("amount"))
|
||||
if not amount:
|
||||
return None
|
||||
price = amount
|
||||
if price <= 0:
|
||||
return None
|
||||
price = amount or 0
|
||||
|
||||
display_prices = price_obj.get("displayPrices", [])
|
||||
price_qualifier = (
|
||||
display_prices[0].get("displayPriceQualifier", "") if display_prices else ""
|
||||
)
|
||||
|
||||
# POA / Auction listings have unreliable prices — treat as no price
|
||||
pq_lower = price_qualifier.lower()
|
||||
non_comparable_price_terms = (
|
||||
"poa",
|
||||
"auction",
|
||||
"shared ownership",
|
||||
"shared equity",
|
||||
"part buy",
|
||||
"part rent",
|
||||
"from",
|
||||
)
|
||||
if any(term in pq_lower for term in non_comparable_price_terms):
|
||||
return None
|
||||
|
||||
sub_type = prop.get("propertySubType", "")
|
||||
raw_beds = parse_int_value(prop.get("bedrooms")) or 0
|
||||
raw_baths = parse_int_value(prop.get("bathrooms")) or 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue