Utils methods¶
-
domiporta.utils.
encode_text_to_html
(text)[source]¶ Change text to lower cases, gets rid of polish characters replacing them with simplified version, replaces spaces with dashes
Parameters: text (str) – text to encode Returns: encoded text which can be used in url Return type: str
-
domiporta.utils.
get_content_from_source
(url)[source]¶ Connects with given url
If environmental variable DEBUG is True it will cache response for url in /var/temp directory
Parameters: url (str) – Website url Returns: Response for requested url
-
domiporta.utils.
get_url
(category='nieruchomosci', transaction_type='wszystkie', voivodeship=None, city=None, street=None, filters=None)[source]¶ Create url to Domiporta search web page with given parameters and filters
Parameters: - category – Type of property of interest (Mieszkanie/Dom/Garaż/Działka)
- transaction_type – Type of transaction
- voivodeship – Voivodeship
- city – City
- street – Street
- filters – Dictionary with additional filters
:type category:str, None :type transaction_type: str, None :type voivodeship: str, None :type city: str, None :type street: str, None :type filters: dict, None :return: Url to Domiporta search web page :rtype: str