Offer methods

trojmiastopl.offer.get_additional_information(offer_markup)[source]

Searches for additional info and heating type

Parameters:offer_markup (str) – Class “sidebar” from offer page markup
Returns:Additional info with optional heating type
Return type:dict
trojmiastopl.offer.get_apartment_type(offer_markup)[source]

Searches for apartment type in offer markup

Parameters:offer_markup (str) – Class “sidebar” from offer page markup
Returns:Apartment type
Return type:str
trojmiastopl.offer.get_available_from(offer_markup)[source]

Searches for available from in offer markup

Parameters:offer_markup (str) – Class “sidebar” from offer page markup
Returns:Available from or None if there is no information
Return type:str, None
trojmiastopl.offer.get_furnished(offer_markup)[source]

Searches if offer is marked as furnished or not

Parameters:offer_markup (str) – Class “sidebar” from offer page markup
Returns:Information is offer furnished
Return type:bool
Except:If there is no information if offer is furnished it will return None
trojmiastopl.offer.get_img_url(offer_markup)[source]

Searches for images in offer markup

Parameters:offer_markup (str) – Id “gallery” from offer page markup
Returns:Images of offer in list
Return type:list
trojmiastopl.offer.get_month_num_for_string(value)[source]

Map for polish month names

Parameters:value (str) – Month value
Returns:Month number
Return type:int
trojmiastopl.offer.get_surface(offer_markup)[source]

Searches for surface in offer markup

Parameters:offer_markup (str) – Class “sidebar” from offer page markup
Returns:Surface or None if there is no surface
Return type:float, None
Except:When there is no offer surface it will return None
trojmiastopl.offer.get_title(offer_markup)[source]

Searches for offer title on offer page

Parameters:offer_markup (str) – Class “title-wrap” from offer page markup
Returns:Title of offer or None if there is no title
Return type:str, None
Except:Returns None when couldn’t find title of offer page.
trojmiastopl.offer.parse_date_to_timestamp(date)[source]

Parses string date to unix timestamp

Parameters:date (str) – Date
Returns:Unix timestamp
Return type:int
trojmiastopl.offer.parse_dates_and_id(offer_markup)[source]

Searches for date of creating and date of last update of an offer. Additionally parses offer id number.

Parameters:offer_markup (str) – Class “sidebar” from offer page markup
Returns:Date added and date updated if found and offer id (id, added, updated)
Return type:dict
trojmiastopl.offer.parse_description(description_markup)[source]

Searches for offer description

Parameters:description_markup (str) – Class “ogl-description” from offer page markup
Returns:Offer description
Return type:str
trojmiastopl.offer.parse_flat_data(offer_markup)[source]

Parses flat data from sidebar

Parameters:offer_markup (str) – Class “sidebar” from offer page markup
Returns:Information about price, deposit, floor, number of rooms, date of built and

total count of floors in building :rtype: dict

trojmiastopl.offer.parse_offer(url)[source]

Parses data from offer page url

Parameters:url (str) – Url of current offer page
Returns:Dictionary with all offer details
Return type:dict
Except:If there is no offer title anymore - offer got deleted.
trojmiastopl.offer.parse_poster_name(contact_markup)[source]

Parses poster name

Parameters:contact_markup (str) – Class “contact-box” from offer page markup
Returns:Poster name
Return type:str
trojmiastopl.offer.parse_region(offer_markup)[source]

Parses region information

Parameters:offer_markup (str) – Class “sidebar” from offer page markup
Returns:Region of offer
Return type:dict