mementoweb.validator.util package¶
Submodules¶
mementoweb.validator.util.http module¶
- class mementoweb.validator.util.http.HttpConnection(host, scheme, uri)¶
Bases:
object
An adapter class for HTTPConnection. Used for isolating urlib incase of issues in the future.
- get_response() mementoweb.validator.util.http.HttpResponse ¶
- request(method, path, headers)¶
- class mementoweb.validator.util.http.HttpResponse(response: Optional[http.client.HTTPResponse] = None, uri='')¶
Bases:
object
An adapter class for isolating urlib incase of future changes/ issues. Encapsulates HTTP response from an established connection.
- body = None¶
- get_body()¶
- get_headers(name: str) str ¶
- header_keys() List ¶
- link_parser: mementoweb.validator.util.link_parser.LinkParser = <mementoweb.validator.util.link_parser.RegexLinkParser object>¶
- parse_body()¶
- search_link_headers()¶
- status = None¶
- mementoweb.validator.util.http.http(uri: str, datetime='Thu, 10 Oct 2009 12:00:00 GMT', accept='text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', accept_language='en-us,en;q=0.5', proxy_connection='keep-alive', user_agent='Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2', method='HEAD') mementoweb.validator.util.http.HttpConnection ¶
Initiates HTTP connections using the given parameters using the HTTP Adapter.
- Parameters
uri – URI for the connection
datetime – Datetime for Accept-Datetime header
accept – Content type for Accept header
accept_language – language for Accept-Language head
proxy_connection – value for Proxy-Connection header
user_agent – User-Agent header
:param method:request method. Defaults to HEAD. :return: HTTP connection using the given parameters.
mementoweb.validator.util.link_parser module¶
- class mementoweb.validator.util.link_parser.CharacterLinkParser¶
Bases:
mementoweb.validator.util.link_parser.LinkParser
- parse()¶
- class mementoweb.validator.util.link_parser.LinkParserResult(uri: str = '', relationship: str = '', link_type: str = '', datetime: str = '', title: str = '', link_from: str = '', link_until: str = '')¶
Bases:
object
- datetime: str = ''¶
- link_from: str = ''¶
- link_type: str = ''¶
- link_until: str = ''¶
- relationship: str = ''¶
- title: str = ''¶
- uri: str = ''¶
- class mementoweb.validator.util.link_parser.RegexLinkParser(split_point='[,]\\s*[<]')¶
Bases:
mementoweb.validator.util.link_parser.LinkParser
- parse()¶