diff --git a/README.md b/README.md index 9e2534f..09ddec6 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ filename = f"HomeHarvest_{current_timestamp}.csv" properties = scrape_property( location="San Diego, CA", 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 # mls_only=True, # only fetch MLS listings # proxy="http://user:pass@host:port" # use a proxy to change your IP address diff --git a/examples/HomeHarvest_Demo.py b/examples/HomeHarvest_Demo.py index 6ab64d9..46d31b1 100644 --- a/examples/HomeHarvest_Demo.py +++ b/examples/HomeHarvest_Demo.py @@ -8,7 +8,7 @@ filename = f"HomeHarvest_{current_timestamp}.csv" properties = scrape_property( location="San Diego, CA", 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 # mls_only=True, # only fetch MLS listings # proxy="http://user:pass@host:port" # use a proxy to change your IP address diff --git a/homeharvest/__init__.py b/homeharvest/__init__.py index 63aa13f..9db3f69 100644 --- a/homeharvest/__init__.py +++ b/homeharvest/__init__.py @@ -12,7 +12,7 @@ def scrape_property( listing_type: str = "for_sale", radius: float = None, mls_only: bool = False, - property_younger_than: int = None, + past_days: int = None, pending_or_contingent: bool = False, proxy: str = None, ) -> pd.DataFrame: @@ -22,7 +22,7 @@ def scrape_property( :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 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 proxy: Proxy to use for scraping """ @@ -34,7 +34,7 @@ def scrape_property( proxy=proxy, radius=radius, mls_only=mls_only, - last_x_days=property_younger_than, + last_x_days=past_days, pending_or_contingent=pending_or_contingent, ) diff --git a/homeharvest/cli.py b/homeharvest/cli.py index 13ed44d..881572f 100644 --- a/homeharvest/cli.py +++ b/homeharvest/cli.py @@ -75,7 +75,7 @@ def main(): radius=args.radius, proxy=args.proxy, mls_only=args.mls_only, - property_younger_than=args.days, + past_days=args.days, pending_or_contingent=args.pending_or_contingent, ) diff --git a/tests/test_realtor.py b/tests/test_realtor.py index fd16cf0..05fa0c6 100644 --- a/tests/test_realtor.py +++ b/tests/test_realtor.py @@ -29,7 +29,7 @@ def test_realtor_comps(): result = scrape_property( location="2530 Al Lipscomb Way", radius=0.5, - property_younger_than=180, + past_days=180, listing_type="sold", ) @@ -38,11 +38,11 @@ def test_realtor_comps(): def test_realtor_last_x_days_sold(): 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( - location="Dallas, TX", listing_type="sold", property_younger_than=10 + location="Dallas, TX", listing_type="sold", past_days=10 ) assert all(