domain_utils package¶
Submodules¶
domain_utils.domain_utils module¶
-
domain_utils.domain_utils.get_ps_plus_1(url, **kwargs)[source]¶ Returns the PS+1 of the url. This will also return an IP address if the hostname of the url is a valid IP address. An (optional) PublicSuffixList object can be passed with keyword arg ‘psl’, otherwise a version cached in the system temp directory is used.
-
domain_utils.domain_utils.get_psl(location='/tmp/public_suffix_list.dat')[source]¶ Grabs an updated public suffix list.
-
domain_utils.domain_utils.get_stripped_url(url, scheme=False)[source]¶ Returns a url stripped to (scheme)?+hostname+path
-
domain_utils.domain_utils.hostname_subparts(url, include_ps=False, **kwargs)[source]¶ Returns a list of slices of a url’s hostname down to the PS+1 If include_ps is set, the hostname slices will include the public suffix For example: http://a.b.c.d.com/path?query#frag would yield:
[a.b.c.d.com, b.c.d.com, c.d.com, d.com] if include_ps == False [a.b.c.d.com, b.c.d.com, c.d.com, d.com, com] if include_ps == TrueAn (optional) PublicSuffixList object can be passed with keyword arg ‘psl’. otherwise a version cached in the system temp directory is used.
Module contents¶
Top-level package for Domain Utils.