Utils methods

morizon.utils.encode_text_to_url(text)[source]

Change text to lower cases, gets rid of polish characters replacing them with simplified version, replaces spaces with dashes

Parameters:text (str) – raw text
Returns:encoded text which can be used in url
Return type:str
morizon.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
morizon.utils.get_max_page(url)[source]

Reads total page number on Morizon search page

Parameters:url (str) – web page url
Returns:number on sub web pages for search
Return type:int