PK.>J;&/%%url_checker/__init__.py""" Will make request to provided url with given method and return the response code. :param url: The URL to test. :param method: Request method (GET, PUT, POST, etc.) :param reformat_url: Use the URL as passed or fix/reformat it. :return: Status code of returned response EXAMPLE: >>> from urlcheck import get_response_code as grc >>> grc('http://arstechnica.com/not_real', method='put') 404 >>> grc('www.yahoo.com/sports') 200 >>> grc('google.com') 200 """ from requests import request __version__ = "1.0.0" def format_url(url: str = None) -> str: """ Take url which may or may-not be formatted and return a formatted one. :param url: URL to format. :return: Formatted URL. EXAMPLE: >>> from urlcheck import format_url >>> format_url('http://yahoo.com') 'http://www.yahoo.com' >>> format_url('yahoo.com') 'http://www.yahoo.com' >>> format_url('www.yahoo.com') 'http://www.yahoo.com' >>> format_url('http://www.yahoo.com') 'http://www.yahoo.com' """ if url.startswith('http://www.'): formatted = str(url) elif url.startswith('www.'): formatted = 'http://' + url elif url.startswith('http://'): formatted = url.replace('//', '//www.') else: formatted = 'http://www.' + url return formatted def get_response_code(url: str = None, method: str = 'GET', reformat_url: bool = True) -> int: """ Will make request to provided url with given method and return the response code. :param url: The URL to test. :param method: Request method (GET, PUT, POST, etc.) :param reformat_url: Use the URL as passed or fix/reformat it. :return: Status code of returned response EXAMPLE: >>> from urlcheck import get_response_code as grc >>> grc('http://arstechnica.com/not_real', method='put') 404 >>> grc('www.yahoo.com/sports') 200 >>> grc('google.com') 200 """ url = format_url(url) if reformat_url else url return request(method=method, url=url).status_code PK>Jy>hbburl_checker/test_module.pyimport pytest def test_placeholder(): pass if __name__ == '__main__': pytest.main("-v")PK!H|&Ub!url_checker-1.0.0.dist-info/WHEEL HM K-*ϳR03rOK-J,/RH,Q034 /, (-JLR()*M ILR(4KM̫#DPK!HV$url_checker-1.0.0.dist-info/METADATAmOO0 >¡麡 E1 I?GdZZk$H1 X䕬c*XIAobMV#9^k;o4qM`'pIeL-*P |mJqo4%VE}TViM--m]aG.u?˷\fRB`KSTm'S,Wsuq0wx/,ؒKyk*# 9ecltB.`==⎿p#: &QPK!Hz"url_checker-1.0.0.dist-info/RECORD̻v0oYM~QuVef|l0]$`̀qL_9E̲w Å8%Omh/DvKÿ/ |oEW^lG}f!~.jM"7;PPK.>J;&/%%url_checker/__init__.pyPK>Jy>hbbZurl_checker/test_module.pyPK!H|&Ub!url_checker-1.0.0.dist-info/WHEELPK!HV$ url_checker-1.0.0.dist-info/METADATAPK!Hz" url_checker-1.0.0.dist-info/RECORDPK~#