- office mls set

pull/102/head v0.4.2
Zachary Hampton 2024-08-23 10:54:43 -07:00
parent 1010c743b6
commit 8cfe056f79
4 changed files with 6 additions and 2 deletions

View File

@ -106,6 +106,7 @@ class Agent(Entity):
@dataclass @dataclass
class Office(Entity): class Office(Entity):
mls_set: str | None = None
email: str | None = None email: str | None = None
href: str | None = None href: str | None = None
phones: list[dict] | AgentPhone | None = None phones: list[dict] | AgentPhone | None = None

View File

@ -130,7 +130,8 @@ class RealtorScraper(Scraper):
if advertiser.get("office"): #: has an office if advertiser.get("office"): #: has an office
processed_advertisers.office = Office( processed_advertisers.office = Office(
uuid=_parse_fulfillment_id(advertiser["office"].get("fulfillment_id")) or advertiser["office"].get("mls_set"), uuid=_parse_fulfillment_id(advertiser["office"].get("fulfillment_id")),
mls_set=advertiser["office"].get("mls_set"),
name=advertiser["office"].get("name"), name=advertiser["office"].get("name"),
email=advertiser["office"].get("email"), email=advertiser["office"].get("email"),
phones=advertiser["office"].get("phones"), phones=advertiser["office"].get("phones"),

View File

@ -53,6 +53,7 @@ ordered_properties = [
"builder_id", "builder_id",
"builder_name", "builder_name",
"office_id", "office_id",
"office_mls_set",
"office_name", "office_name",
"office_email", "office_email",
"office_phones", "office_phones",
@ -102,6 +103,7 @@ def process_result(result: Property) -> pd.DataFrame:
prop_data["office_name"] = office_data.name prop_data["office_name"] = office_data.name
prop_data["office_email"] = office_data.email prop_data["office_email"] = office_data.email
prop_data["office_phones"] = office_data.phones prop_data["office_phones"] = office_data.phones
prop_data["office_mls_set"] = office_data.mls_set
prop_data["price_per_sqft"] = prop_data["prc_sqft"] prop_data["price_per_sqft"] = prop_data["prc_sqft"]
prop_data["nearby_schools"] = filter(None, prop_data["nearby_schools"]) if prop_data["nearby_schools"] else None prop_data["nearby_schools"] = filter(None, prop_data["nearby_schools"]) if prop_data["nearby_schools"] else None

View File

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "homeharvest" name = "homeharvest"
version = "0.4.1" version = "0.4.2"
description = "Real estate scraping library" description = "Real estate scraping library"
authors = ["Zachary Hampton <zachary@bunsly.com>", "Cullen Watson <cullen@bunsly.com>"] authors = ["Zachary Hampton <zachary@bunsly.com>", "Cullen Watson <cullen@bunsly.com>"]
homepage = "https://github.com/Bunsly/HomeHarvest" homepage = "https://github.com/Bunsly/HomeHarvest"