woob.capabilities.housing

class CapHousing[source]

Bases: Capability

Capability of websites to search housings.

search_housings(query)[source]

Search housings.

Parameters:

query (Query) – search query

Return type:

iter[Housing]

get_housing(housing)[source]

Get an housing from an ID.

Parameters:

housing (str) – ID of the housing

Return type:

Housing or None if not found.

search_city(pattern)[source]

Search a city from a pattern.

Parameters:

pattern (str) – pattern to search

Return type:

iter[City]

class Housing(id='', url=NotLoaded, backend=None)[source]

Bases: BaseObject

Content of a housing.

Variables:
  • url – (str) url

  • type – (str) Type of housing (rent, sale, sharing)

  • advert_type – (str) Type of advert (professional or personal)

  • house_type – (str) Type of house (apartment, house, parking, …)

  • title – (str) Title of housing

  • area – (Decimal) Area of housing, in m2

  • cost – (Decimal) Cost of housing

  • price_per_meter – (Decimal) Price per meter ratio

  • currency – (str) Currency of cost

  • utilities – (str) Utilities included or not

  • date – (date, datetime) Date when the housing has been published

  • address – (PostalAddress) Location of housing

  • station – (str) What metro/bus station next to housing

  • text – (str) Text of the housing

  • phone – (str) Phone number to contact

  • photos – (list) List of photos

  • rooms – (Decimal) Number of rooms

  • bedrooms – (Decimal) Number of bedrooms

  • details – (dict) Key/values of details

  • DPE – (str) DPE (Energy Performance Certificate)

  • GES – (str) GES (Greenhouse Gas Emissions)

property location
class Query(id='', url=NotLoaded, backend=None)[source]

Bases: BaseObject

Query to find housings.

Variables:
  • url – (str) url

  • type – (str) Type of housing to find (POSTS_TYPES constants)

  • cities – (list, tuple) List of cities to search in

  • area_min – (int) Minimal area (in m2)

  • area_max – (int) Maximal area (in m2)

  • cost_min – (int) Minimal cost

  • cost_max – (int) Maximal cost

  • nb_rooms – (int) Number of rooms

  • house_types – (list, tuple) List of house types (default: [‘Apartment’, ‘House’, ‘Parking’, ‘Land’, ‘Other’, ‘Unknown’])

  • advert_types – (list, tuple) List of advert types to filter on (default: [‘Professional’, ‘Personal’])

class City(id='', url=NotLoaded, backend=None)[source]

Bases: BaseObject

City.

Variables:
  • url – (str) url

  • name – (str) Name of city

class UTILITIES(*args, **kwargs)[source]

Bases: Enum

INCLUDED = 'C.C.'
EXCLUDED = 'H.C.'
UNKNOWN = ''
class ENERGY_CLASS(*args, **kwargs)[source]

Bases: Enum

A = 'A'
B = 'B'
C = 'C'
D = 'D'
E = 'E'
F = 'F'
G = 'G'
class POSTS_TYPES(*args, **kwargs)[source]

Bases: Enum

RENT = 'RENT'
SALE = 'SALE'
SHARING = 'SHARING'
FURNISHED_RENT = 'FURNISHED_RENT'
VIAGER = 'VIAGER'
class ADVERT_TYPES(*args, **kwargs)[source]

Bases: Enum

PROFESSIONAL = 'Professional'
PERSONAL = 'Personal'
class HOUSE_TYPES(*args, **kwargs)[source]

Bases: Enum

APART = 'Apartment'
HOUSE = 'House'
PARKING = 'Parking'
LAND = 'Land'
OTHER = 'Other'
UNKNOWN = 'Unknown'
exception TypeNotSupported(msg='This type of house is not supported by this module')[source]

Bases: UserError

Raised when query type is not supported

class HousingPhoto(url)[source]

Bases: BaseImage

Photo of a housing.

Variables:
  • url – (str) url

  • title – (str) File title

  • ext – (str) File extension

  • mime_type – (str) MIME Type

  • author – (str) File author

  • description – (str) File description

  • date – (date, datetime) File publication date

  • last_update – (date, datetime) Last update or last modified date (default: Not available)

  • size – (int) File size in bytes (default: Not available)

  • rating – (int, float) Rating (default: Not available)

  • rating_max – (int, float) Maximum rating (default: Not available)

  • license – (str) License name

  • nsfw – (bool) Is this Not Safe For Work (default: False)

  • thumbnail – (Thumbnail) Thumbnail of the image

  • data – (bytes) Data of photo