adding service charge as the info into the sheet
This commit is contained in:
parent
5305451fe8
commit
966b9007a0
1 changed files with 20 additions and 2 deletions
|
|
@ -190,10 +190,26 @@ class Listing:
|
|||
return float(matches[0])
|
||||
return None
|
||||
|
||||
@property
|
||||
def serviceCharge(self) -> float:
|
||||
ds = self.detailobject["property"].get("tenureInfo", {}).get("content", [])
|
||||
for d in ds:
|
||||
if d["type"] == "annualServiceCharge":
|
||||
matches = re.findall(r"([\d,.]+)", d["value"])
|
||||
if len(matches):
|
||||
# remove separators (e.g. 6,395.76)
|
||||
match = matches[0].replace(",", "")
|
||||
return float(match)
|
||||
return None
|
||||
|
||||
@property
|
||||
def development(self) -> bool:
|
||||
# aka new home
|
||||
try:
|
||||
return self.detailobject["property"]["development"]
|
||||
except:
|
||||
print(self.identifier)
|
||||
return False
|
||||
|
||||
def dict_nicely(self):
|
||||
return {
|
||||
|
|
@ -203,7 +219,9 @@ class Listing:
|
|||
"price_per_sqm": self.price_per_sqm,
|
||||
"url": self.url,
|
||||
"bedrooms": self.bedrooms,
|
||||
"travel_time_fastest": self.travel_time[0],
|
||||
"travel_time_fastest": None
|
||||
if len(self.travel_time) == 0
|
||||
else self.travel_time[0],
|
||||
"travel_time_second": None
|
||||
if len(self.travel_time) < 2
|
||||
else self.travel_time[1],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue