- readme.md

This commit is contained in:
Zachary Hampton
2025-07-15 14:11:55 -07:00
parent 2d75ca4dfa
commit 643daad5d2

125
README.md
View File

@@ -47,6 +47,22 @@ properties.to_csv(filename, index=False)
print(properties.head()) print(properties.head())
``` ```
### Flexible Location Formats
```py
# HomeHarvest supports any of these location formats:
properties = scrape_property(location="92104") # Just zip code
properties = scrape_property(location="San Diego") # Just city
properties = scrape_property(location="San Diego, CA") # City, state
properties = scrape_property(location="San Diego, California") # Full state name
properties = scrape_property(location="1234 Main St, San Diego, CA 92104") # Full address
# You can also search for properties within a radius of a specific address
properties = scrape_property(
location="1234 Main St, San Diego, CA 92104",
radius=5.0 # 5 mile radius
)
```
## Output ## Output
```plaintext ```plaintext
>>> properties.head() >>> properties.head()
@@ -59,10 +75,35 @@ print(properties.head())
[5 rows x 22 columns] [5 rows x 22 columns]
``` ```
### Using Pydantic Models
```py
from homeharvest import scrape_property
# Get properties as Pydantic models for type safety and data validation
properties = scrape_property(
location="San Diego, CA",
listing_type="for_sale",
return_type="pydantic" # Returns list of Property models
)
# Access model fields with full type hints and validation
for prop in properties[:5]:
print(f"Address: {prop.address.formatted_address}")
print(f"Price: ${prop.list_price:,}")
if prop.description:
print(f"Beds: {prop.description.beds}, Baths: {prop.description.baths_full}")
```
### Parameters for `scrape_property()` ### Parameters for `scrape_property()`
``` ```
Required Required
├── location (str): The address in various formats - this could be just a zip code, a full address, or city/state, etc. ├── location (str): Flexible location search - accepts any of these formats:
- ZIP code: "92104"
- City: "San Diego" or "San Francisco"
- City, State (abbreviated or full): "San Diego, CA" or "San Diego, California"
- Full address: "1234 Main St, San Diego, CA 92104"
- Neighborhood: "Downtown San Diego"
- County: "San Diego County"
├── listing_type (option): Choose the type of listing. ├── listing_type (option): Choose the type of listing.
- 'for_rent' - 'for_rent'
- 'for_sale' - 'for_sale'
@@ -120,14 +161,17 @@ Property
│ ├── listing_id │ ├── listing_id
│ ├── mls │ ├── mls
│ ├── mls_id │ ├── mls_id
── status ── mls_status
│ ├── status
│ └── permalink
├── Address Details: ├── Address Details (Pydantic/Raw):
│ ├── street │ ├── street
│ ├── unit │ ├── unit
│ ├── city │ ├── city
│ ├── state │ ├── state
── zip_code ── zip_code
│ └── formatted_address* # Computed field
├── Property Description: ├── Property Description:
│ ├── style │ ├── style
@@ -138,54 +182,69 @@ Property
│ ├── year_built │ ├── year_built
│ ├── stories │ ├── stories
│ ├── garage │ ├── garage
── lot_sqft ── lot_sqft
│ ├── text # Full description text
│ └── type
├── Property Listing Details: ├── Property Listing Details:
│ ├── days_on_mls │ ├── days_on_mls
│ ├── list_price │ ├── list_price
│ ├── list_price_min │ ├── list_price_min
│ ├── list_price_max │ ├── list_price_max
│ ├── list_date │ ├── list_date # datetime
│ ├── pending_date │ ├── pending_date # datetime
│ ├── sold_price │ ├── sold_price
│ ├── last_sold_date │ ├── last_sold_date # datetime
│ ├── last_sold_price
│ ├── price_per_sqft │ ├── price_per_sqft
│ ├── new_construction │ ├── new_construction
── hoa_fee ── hoa_fee
│ ├── monthly_fees # List of fees
│ ├── one_time_fees # List of fees
│ └── estimated_value
├── Tax Information: ├── Tax Information:
├── year │ ├── tax_assessed_value
── tax ── tax_history # List with years, amounts, assessments
│ ├── assessment
│ │ ├── building
│ │ ├── land
│ │ └── total
├── Location Details: ├── Location Details:
│ ├── latitude │ ├── latitude
│ ├── longitude │ ├── longitude
│ ├── nearby_schools │ ├── neighborhoods
│ ├── county
│ ├── fips_code
│ ├── parcel_number
│ └── nearby_schools
├── Agent Info: ├── Agent/Broker/Office Info (Pydantic/Raw):
│ ├── agent_id │ ├── agent_uuid
│ ├── agent_name │ ├── agent_name
│ ├── agent_email │ ├── agent_email
── agent_phone ── agent_phone
│ ├── agent_state_license
├── Broker Info: ├── broker_uuid
│ ├── broker_id │ ├── broker_name
── broker_name ── office_uuid
├── Builder Info:
│ ├── builder_id
│ └── builder_name
├── Office Info:
│ ├── office_id
│ ├── office_name │ ├── office_name
│ ├── office_phones │ ├── office_email
│ └── office_email │ └── office_phones
├── Additional Fields (Pydantic/Raw only):
│ ├── estimated_monthly_rental
│ ├── tags # Property tags/features
│ ├── flags # Status flags (foreclosure, etc)
│ ├── photos # All property photos
│ ├── primary_photo
│ ├── alt_photos
│ ├── open_houses # List of open house events
│ ├── units # For multi-family properties
│ ├── pet_policy
│ ├── parking
│ ├── terms # Listing terms
│ ├── current_estimates # Platform estimates with sources
│ └── estimates # Historical estimates
* Only available when using return_type='pydantic'
``` ```
### Exceptions ### Exceptions