GithubHelp home page GithubHelp logo

aliluc / househunt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from althor880/househunt

0.0 0.0 0.0 150 KB

Python module to search Redfin and combine with results from the Zillow API

License: MIT License

Python 100.00%

househunt's Introduction

househunt

Python module to search Redfin and combine with results from the Zillow API

Setup

There must be a file named 'ZWSID' in the working directory, which contains on the first line your Zillow API ID

Classes in house.py

House

Class that describes a house and its physical details.

Properties:

  • street_address
  • city
  • state
  • zip_code
  • beds
  • baths
  • sq_ft
  • parking
  • parking_type
  • lot_size
  • home_type

Methods

  • hsh:
    • Returns a md5 hash of the house's address, city, state, and zip - used to uniquely identify house for cacheing purposes
  • detailed:
    • Returns a formatted string containing more details than the basic string representation
  • to_dict():
    • returns a dictionary containing all the properties of the house object. Formatted so as to be useable with the .from_dict(dictionary) method. (useful for serializing the object in a .json file)
  • from_dict(dictionary):
    • Takes a dictionary as an argument and builds a House object using the key/values. The dictionary must contain a value for each of the classes properties (e.x. dictionary['street_address'] = "42 Wallaby Way") (useful for loading house objects from a .json file)

Example Usage

>>> from house import House
>>> h = House()
>>> print h
None None, None None
>>> h.street_address = "42 Wallaby Way"
>>> h.city = "Sydney"
>>> h.state = "Australia"
>>> h.zip_code = "12345"
>>> h.beds = 3
>>> h.baths = 1.5
>>> print h
42 Wallaby Way Sydney, Australia 12345
>>> print h.detailed
Address: 42 Wallaby Way Sydney, Australia 12345
Home Type: None
Beds: 3
Baths: 1.5
SqFt: None
Lot Size: None
Parking Spaces: None
Parking Type: None
>>> h2 = House(street_address="1600 Pennsylvania Ave.", city="Washington D.C.", state="Washington D.C.", zip_code="20006")
>>> print h2
1600 Pennsylvania Ave. Washington D.C., Washington D.C. 20006

Listing

Class that describes a real estate listing and its details.

Properties

  • house
    • Contains a House object (see House class for details)
  • list_price
  • zestimate
  • days_on_market
  • original_list_price
  • status
  • mls_id
  • open_house_date
  • open_house_start_time
  • open_house_end_time

Methods

  • hsh:
    • returns the hsh value of the Listing's House object (used for uniquely identifying a listing for cacheing)
  • detailed:
    • Returns a formatted string containing more details than the basic string representation
  • to_dict():
    • returns a dictionary containing all the properties of the listing object. Formatted so as to be useable with the .from_dict(dictionary) method. (useful for serializing the object in a .json file)
  • from_dict(dictionary):
    • Takes a dictionary as an argument and builds a Listing object using the key/values. The dictionary must contain a value for each of the classes properties (e.x. dictionary['list_price'] = 1000000) (useful for loading listing objects from a .json file)
  • get_zestimate():
    • sets the objects zestimate property first checking for a cached value (in order to not exceed the Zillow API restriction on number of requests in 24 hours) and secondly querying the Zillow API. See ListCache class for details on cacheing, ans ZillAPI class for details on querying Zillow.

Example Usage

>>> from house import House, Listing
>>> h = House(street_address="42 Wallaby Way", city="Sydney", state="Australia", zip="12345")
>>> l = Listing(house=h, list_price=123456, days_on_market=5)
>>> print l.detailed
House Details:
Address: 42 Wallaby Way Sydney, Australia 12345
Home Type: None
Beds: 3
Baths: 1.5
SqFt: None
Lot Size: None
Parking Spaces: None
Parking Type: None

Status: None
List Price: 123455
Zestimate: None
MLS ID: None
Days on Market: 5
Original Price: None
>>> l.get_zestimate()
>>> print l.detailed
House Details:
Address: 42 Wallaby Way Sydney, Australia 12345
Home Type: None
Beds: 3
Baths: 1.5
SqFt: None
Lot Size: None
Parking Spaces: None
Parking Type: None

Status: None
List Price: 123455
Zestimate: 554321
MLS ID: None
Days on Market: 5
Original Price: None

househunt's People

Contributors

althor880 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.