Configure search criteria with Daft
masterYou can refine your search by calling configuration methods on the Daft instance before executing .search().
Supported configuration methods include:
set_location(location): Sets the search area (can take aLocationenum or a string).set_search_type(search_type): Sets the type of listing (e.g.,SearchType.RESIDENTIAL_RENT,SearchType.RESIDENTIAL_SALE,SearchType.STUDENT_ACCOMMODATION,SearchType.COMMERCIAL_SALE).set_property_type(property_type): Sets the property category (e.g.,PropertyType.APARTMENT,PropertyType.HOUSE).set_min_price(price): Sets the minimum price.set_max_price(price): Sets the maximum price.set_sort_type(sort_type): Sets the sorting order (e.g.,SortType.PRICE_ASC).set_facility(facility): Adds a required facility (e.g.,Facility.PARKING,Facility.ALARM).
from daftlistings import Daft, Location, SearchType, PropertyType
daft = Daft()
daft.set_location(Location.DUBLIN)
daft.set_search_type(SearchType.RESIDENTIAL_RENT)
daft.set_property_type(PropertyType.APARTMENT)
listings = daft.search()