- rename days variable

pull/34/head
Zachary Hampton 2023-10-04 21:35:14 -07:00
parent ba7ad069c9
commit a9225b532f
5 changed files with 9 additions and 9 deletions

View File

@ -47,7 +47,7 @@ filename = f"HomeHarvest_{current_timestamp}.csv"
properties = scrape_property( properties = scrape_property(
location="San Diego, CA", location="San Diego, CA",
listing_type="sold", # or (for_sale, for_rent) listing_type="sold", # or (for_sale, for_rent)
property_younger_than=30, # sold in last 30 days - listed in last x days if (for_sale, for_rent) past_days=30, # sold in last 30 days - listed in last x days if (for_sale, for_rent)
# pending_or_contingent=True # use on for_sale listings to find pending / contingent listings # pending_or_contingent=True # use on for_sale listings to find pending / contingent listings
# mls_only=True, # only fetch MLS listings # mls_only=True, # only fetch MLS listings
# proxy="http://user:pass@host:port" # use a proxy to change your IP address # proxy="http://user:pass@host:port" # use a proxy to change your IP address

View File

@ -8,7 +8,7 @@ filename = f"HomeHarvest_{current_timestamp}.csv"
properties = scrape_property( properties = scrape_property(
location="San Diego, CA", location="San Diego, CA",
listing_type="sold", # or (for_sale, for_rent) listing_type="sold", # or (for_sale, for_rent)
property_younger_than=30, # sold in last 30 days - listed in last x days if (for_sale, for_rent) past_days=30, # sold in last 30 days - listed in last x days if (for_sale, for_rent)
# pending_or_contingent=True # use on for_sale listings to find pending / contingent listings # pending_or_contingent=True # use on for_sale listings to find pending / contingent listings
# mls_only=True, # only fetch MLS listings # mls_only=True, # only fetch MLS listings
# proxy="http://user:pass@host:port" # use a proxy to change your IP address # proxy="http://user:pass@host:port" # use a proxy to change your IP address

View File

@ -12,7 +12,7 @@ def scrape_property(
listing_type: str = "for_sale", listing_type: str = "for_sale",
radius: float = None, radius: float = None,
mls_only: bool = False, mls_only: bool = False,
property_younger_than: int = None, past_days: int = None,
pending_or_contingent: bool = False, pending_or_contingent: bool = False,
proxy: str = None, proxy: str = None,
) -> pd.DataFrame: ) -> pd.DataFrame:
@ -22,7 +22,7 @@ def scrape_property(
:param listing_type: Listing Type (for_sale, for_rent, sold) :param listing_type: Listing Type (for_sale, for_rent, sold)
:param radius: Get properties within _ (e.g. 1.0) miles. Only applicable for individual addresses. :param radius: Get properties within _ (e.g. 1.0) miles. Only applicable for individual addresses.
:param mls_only: If set, fetches only listings with MLS IDs. :param mls_only: If set, fetches only listings with MLS IDs.
:param property_younger_than: Get properties sold/listed in last _ days. :param past_days: Get properties sold or listed (dependent on your listing_type) in the last _ days.
:param pending_or_contingent: If set, fetches only pending or contingent listings. Only applicable for for_sale listings from general area searches. :param pending_or_contingent: If set, fetches only pending or contingent listings. Only applicable for for_sale listings from general area searches.
:param proxy: Proxy to use for scraping :param proxy: Proxy to use for scraping
""" """
@ -34,7 +34,7 @@ def scrape_property(
proxy=proxy, proxy=proxy,
radius=radius, radius=radius,
mls_only=mls_only, mls_only=mls_only,
last_x_days=property_younger_than, last_x_days=past_days,
pending_or_contingent=pending_or_contingent, pending_or_contingent=pending_or_contingent,
) )

View File

@ -75,7 +75,7 @@ def main():
radius=args.radius, radius=args.radius,
proxy=args.proxy, proxy=args.proxy,
mls_only=args.mls_only, mls_only=args.mls_only,
property_younger_than=args.days, past_days=args.days,
pending_or_contingent=args.pending_or_contingent, pending_or_contingent=args.pending_or_contingent,
) )

View File

@ -29,7 +29,7 @@ def test_realtor_comps():
result = scrape_property( result = scrape_property(
location="2530 Al Lipscomb Way", location="2530 Al Lipscomb Way",
radius=0.5, radius=0.5,
property_younger_than=180, past_days=180,
listing_type="sold", listing_type="sold",
) )
@ -38,11 +38,11 @@ def test_realtor_comps():
def test_realtor_last_x_days_sold(): def test_realtor_last_x_days_sold():
days_result_30 = scrape_property( days_result_30 = scrape_property(
location="Dallas, TX", listing_type="sold", property_younger_than=30 location="Dallas, TX", listing_type="sold", past_days=30
) )
days_result_10 = scrape_property( days_result_10 = scrape_property(
location="Dallas, TX", listing_type="sold", property_younger_than=10 location="Dallas, TX", listing_type="sold", past_days=10
) )
assert all( assert all(