linkcheck.checker

Main functions for link checking.

Functions

absolute_url(base_url, base_ref, parent_url)

Search for the absolute url to detect the link type.

get_index_html(urls)

Construct artificial index.html from given URLs.

get_url_from(base_url, recursion_level, ...)

Get url data from given base data.

get_urlclass_from(scheme[, assume_local_file])

Return checker class for given URL scheme.

guess_url(url)

Guess if URL is a http or ftp URL.

linkcheck.checker.absolute_url(base_url, base_ref, parent_url)[source]

Search for the absolute url to detect the link type. This does not join any url fragments together!

Parameters:
  • base_url (string or None) – base url from a link tag

  • base_ref (string or None) – base url from <base> tag

  • parent_url (string or None) – url of parent document

linkcheck.checker.get_index_html(urls)[source]

Construct artificial index.html from given URLs.

Parameters:

urls (iterator of string) – URL strings

linkcheck.checker.get_url_from(base_url, recursion_level, aggregate, parent_url=None, base_ref=None, line=None, column=None, page=0, name='', parent_content_type=None, extern=None, url_encoding=None)[source]

Get url data from given base data.

Parameters:
  • base_url (string or None) – base url from a link tag

  • recursion_level (number) – current recursion level

  • aggregate (aggregate.Consumer) – aggregate object

  • parent_url (string or None) – parent url

  • base_ref (string or None) – base url from <base> tag

  • line (number) – line number

  • column (number) – column number

  • page (number) – page number

  • name (string) – link name

  • extern (tuple(int, int) or None) – (is_extern, is_strict) or None

linkcheck.checker.get_urlclass_from(scheme, assume_local_file=False)[source]

Return checker class for given URL scheme. If the scheme cannot be matched and assume_local_file is True, assume a local file.

linkcheck.checker.guess_url(url)[source]

Guess if URL is a http or ftp URL.

Parameters:

url (unicode) – the URL to check

Returns:

url with http:// or ftp:// prepended if it’s detected as a http respective ftp URL.

Return type:

unicode

Modules

const

Helper constants.

dnsurl

Handler for dns: links.

fileurl

Handle local file: links.

ftpurl

Handle FTP links.

httpurl

Handle http links.

ignoreurl

Handle ignored URLs.

internpaturl

Intern URL pattern support.

itmsservicesurl

Handle itms-services URLs.

mailtourl

Handler for mailto: links.

unknownurl

Handle uncheckable URLs.

urlbase

Base URL handler.