urlparse
 

# Parse (absolute and relative) URLs.  See RFC 1808: "Relative Uniform
# Resource Locators", by R. Fielding, UC Irvine, June 1995.


 Modules
                                                                                                                                                                                                                               
string


 Functions
                                                                                                                                                                                                                               
clear_cache()
Clear the parse cache.
find(no arg info)
find(s, sub [,start [,end]]) -> in
Return the lowest index in s where substring sub is found,
such that sub is contained within s[start,end].  Optional
arguments start and end are interpreted as in slice notation.
Return -1 on failure.
joinfields(no arg info)
join(list [,sep]) -> string
joinfields(list [,sep]) -> string
Return a string composed of the words in list, with
intervening occurences of sep.  Sep defaults to a single
space.
(join and joinfields are synonymous)
rfind(no arg info)
rfind(s, sub [,start [,end]]) -> int
Return the highest index in s where substring sub is found,
such that sub is contained within s[start,end].  Optional
arguments start and end are interpreted as in slice notation.
Return -1 on failure.
splitfields(no arg info)
split(str [,sep [,maxsplit]]) -> list of strings
splitfields(str [,sep [,maxsplit]]) -> list of strings
Return a list of the words in the string s, using sep as the
delimiter string.  If maxsplit is nonzero, splits into at most
maxsplit words If sep is not specified, any whitespace string
is a separator.  Maxsplit defaults to 0.
(split and splitfields are synonymous)
test()
# XXX The result for //g is actually http://g/; is this a problem?
urldefrag(url)
Removes any existing fragment from URL.
Returns a tuple of the defragmented URL and the fragment.  If
the URL contained no fragments, the second element is the
empty string.
urljoin(base, url, allow_fragments=1)
# Join a base URL and a possibly relative URL to form an absolute
# interpretation of the latter.
urlparse(url, scheme='', allow_fragments=1)
# Parse a URL into 6 components:
# <scheme>://<netloc>/<path>;<params>?<query>#<fragment>
# Return a 6-tuple: (scheme, netloc, path, params, query, fragment).
# Note that we don't break the components up in smaller bits
# (e.g. netloc is a single string) and we don't expand % escapes.
urlunparse((scheme, netloc, url, params, query, fragment))
# Put a parsed URL back together again.  This may result in a slightly
# different, but equivalent URL, if the URL that was parsed originally
# had redundant delimiters, e.g. a ? with an empty query (the draft
# states that these are equivalent).