added county, fips, and text desciption fields (#72)
parent
7246703999
commit
7a525caeb8
|
@ -73,6 +73,7 @@ class Description:
|
||||||
year_built: int | None = None
|
year_built: int | None = None
|
||||||
garage: float | None = None
|
garage: float | None = None
|
||||||
stories: int | None = None
|
stories: int | None = None
|
||||||
|
text: str | None = None
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
@ -101,6 +102,7 @@ class Property:
|
||||||
latitude: float | None = None
|
latitude: float | None = None
|
||||||
longitude: float | None = None
|
longitude: float | None = None
|
||||||
neighborhoods: Optional[str] = None
|
neighborhoods: Optional[str] = None
|
||||||
|
county: Optional[str] = None
|
||||||
|
fips_code: Optional[str] = None
|
||||||
agents: list[Agent] = None
|
agents: list[Agent] = None
|
||||||
nearby_schools: list[str] = None
|
nearby_schools: list[str] = None
|
||||||
|
|
|
@ -176,6 +176,7 @@ class RealtorScraper(Scraper):
|
||||||
year_built=property_info["details"].get("year_built"),
|
year_built=property_info["details"].get("year_built"),
|
||||||
garage=property_info["details"].get("garage"),
|
garage=property_info["details"].get("garage"),
|
||||||
stories=property_info["details"].get("stories"),
|
stories=property_info["details"].get("stories"),
|
||||||
|
text=property_info["description"].get("text"),
|
||||||
),
|
),
|
||||||
days_on_mls=days_on_mls,
|
days_on_mls=days_on_mls,
|
||||||
agents=agents_schools["agents"],
|
agents=agents_schools["agents"],
|
||||||
|
@ -330,6 +331,7 @@ class RealtorScraper(Scraper):
|
||||||
type
|
type
|
||||||
name
|
name
|
||||||
stories
|
stories
|
||||||
|
text
|
||||||
}
|
}
|
||||||
source {
|
source {
|
||||||
id
|
id
|
||||||
|
@ -353,10 +355,17 @@ class RealtorScraper(Scraper):
|
||||||
lat
|
lat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
county {
|
||||||
|
name
|
||||||
|
fips_code
|
||||||
|
}
|
||||||
neighborhoods {
|
neighborhoods {
|
||||||
name
|
name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tax_record {
|
||||||
|
public_record_id
|
||||||
|
}
|
||||||
primary_photo {
|
primary_photo {
|
||||||
href
|
href
|
||||||
}
|
}
|
||||||
|
@ -536,6 +545,9 @@ class RealtorScraper(Scraper):
|
||||||
longitude=result["location"]["address"]["coordinate"].get("lon") if able_to_get_lat_long else None,
|
longitude=result["location"]["address"]["coordinate"].get("lon") if able_to_get_lat_long else None,
|
||||||
address=self._parse_address(result, search_type="general_search"),
|
address=self._parse_address(result, search_type="general_search"),
|
||||||
description=self._parse_description(result),
|
description=self._parse_description(result),
|
||||||
|
neighborhoods=self._parse_neighborhoods(result),
|
||||||
|
county=result["location"]["county"].get("name"),
|
||||||
|
fips_code=result["location"]["county"].get("fips_code"),
|
||||||
days_on_mls=self.calculate_days_on_mls(result),
|
days_on_mls=self.calculate_days_on_mls(result),
|
||||||
agents=agents_schools["agents"],
|
agents=agents_schools["agents"],
|
||||||
nearby_schools=agents_schools["schools"],
|
nearby_schools=agents_schools["schools"],
|
||||||
|
@ -725,6 +737,7 @@ class RealtorScraper(Scraper):
|
||||||
year_built=description_data.get("year_built"),
|
year_built=description_data.get("year_built"),
|
||||||
garage=description_data.get("garage"),
|
garage=description_data.get("garage"),
|
||||||
stories=description_data.get("stories"),
|
stories=description_data.get("stories"),
|
||||||
|
text=description_data.get("text"),
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
|
@ -8,6 +8,7 @@ ordered_properties = [
|
||||||
"mls",
|
"mls",
|
||||||
"mls_id",
|
"mls_id",
|
||||||
"status",
|
"status",
|
||||||
|
"text",
|
||||||
"style",
|
"style",
|
||||||
"street",
|
"street",
|
||||||
"unit",
|
"unit",
|
||||||
|
@ -28,6 +29,9 @@ ordered_properties = [
|
||||||
"price_per_sqft",
|
"price_per_sqft",
|
||||||
"latitude",
|
"latitude",
|
||||||
"longitude",
|
"longitude",
|
||||||
|
"neighborhoods",
|
||||||
|
"county",
|
||||||
|
"fips_code",
|
||||||
"stories",
|
"stories",
|
||||||
"hoa_fee",
|
"hoa_fee",
|
||||||
"parking_garage",
|
"parking_garage",
|
||||||
|
@ -77,6 +81,8 @@ def process_result(result: Property) -> pd.DataFrame:
|
||||||
prop_data["year_built"] = description.year_built
|
prop_data["year_built"] = description.year_built
|
||||||
prop_data["parking_garage"] = description.garage
|
prop_data["parking_garage"] = description.garage
|
||||||
prop_data["stories"] = description.stories
|
prop_data["stories"] = description.stories
|
||||||
|
prop_data["text"] = description.text
|
||||||
|
|
||||||
|
|
||||||
properties_df = pd.DataFrame([prop_data])
|
properties_df = pd.DataFrame([prop_data])
|
||||||
properties_df = properties_df.reindex(columns=ordered_properties)
|
properties_df = properties_df.reindex(columns=ordered_properties)
|
||||||
|
|
Loading…
Reference in New Issue