Parse (absolute and relative) URLs.
See RFC 1808: "Relative Uniform Resource Locators", by R.
Fielding, UC Irvine, June 1995.
|
|
clear_cache()
Clear the parse cache. |
|
|
|
|
urlparse(url,
scheme='',
allow_fragments=True)
Parse a URL into 6 components:
<scheme>://<netloc>/<path>;<params>?<query>#<fragment>
Return a 6-tuple: (scheme, netloc, path, params, query, fragment). |
|
|
|
|
|
|
|
| _splitnetloc(url,
start=0) |
|
|
|
|
urlsplit(url,
scheme='',
allow_fragments=True)
Parse a URL into 5 components:
<scheme>://<netloc>/<path>?<query>#<fragment>
Return a 5-tuple: (scheme, netloc, path, query, fragment). |
|
|
|
|
urlunparse((scheme, netloc, url, params, query, fragment))
Put a parsed URL back together again. |
|
|
|
|
| urlunsplit((scheme, netloc, url, query, fragment)) |
|
|
|
|
urljoin(base,
url,
allow_fragments=True)
Join a base URL and a possibly relative URL to form an absolute
interpretation of the latter. |
|
|
|
|
urldefrag(url)
Removes any existing fragment from URL. |
|
|
|
|
|
|
|
uses_relative = ['ftp', 'http', 'gopher', 'nntp', 'imap', 'wai...
|
|
|
uses_netloc = ['ftp', 'http', 'gopher', 'nntp', 'telnet', 'ima...
|
|
|
non_hierarchical = ['gopher', 'hdl', 'mailto', 'news', 'telnet...
|
|
|
uses_params = ['ftp', 'hdl', 'prospero', 'http', 'imap', 'http...
|
|
|
uses_query = ['http', 'wais', 'imap', 'https', 'shttp', 'mms',...
|
|
|
uses_fragment = ['ftp', 'hdl', 'http', 'gopher', 'news', 'nntp...
|
|
|
scheme_chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST...
|
|
|
MAX_CACHE_SIZE = 20
|
|
|
_parse_cache = {}
|
|
|
test_input = '\n http://a/b/c/d\n\n g:h = <UR...
|