adding days updated
This commit is contained in:
parent
f98cd02696
commit
6d343e52e7
2 changed files with 14 additions and 1 deletions
|
|
@ -4,6 +4,8 @@ import pathlib
|
|||
from typing import List, Dict
|
||||
from rec import floorplan, routing
|
||||
import re
|
||||
import datetime
|
||||
|
||||
|
||||
_DATA_DIR = pathlib.Path("data/rs/")
|
||||
|
||||
|
|
@ -193,6 +195,13 @@ class Listing:
|
|||
if len(matches):
|
||||
return float(matches[0])
|
||||
return None
|
||||
|
||||
@property
|
||||
def updateDaysAgo(self) -> int:
|
||||
ts = self.detailobject["property"]["updateDate"] / 1000
|
||||
now = datetime.datetime.now()
|
||||
ds = datetime.datetime.fromtimestamp(ts)
|
||||
return (now - ds).days
|
||||
|
||||
@property
|
||||
def serviceCharge(self) -> float:
|
||||
|
|
@ -233,6 +242,7 @@ class Listing:
|
|||
"service_charge": self.serviceCharge,
|
||||
"development": self.development,
|
||||
"tenure_type": self.tenure_type,
|
||||
"updated_days": self.updateDaysAgo,
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue