Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
url.py File Reference

Go to the source code of this file.

Data Structures

class  Url
 

Namespaces

namespace  pip
 
namespace  pip._vendor
 
namespace  pip._vendor.urllib3
 
namespace  pip._vendor.urllib3.util
 
namespace  pip._vendor.urllib3.util.url
 

Functions

 split_first (s, delims)
 
 _encode_invalid_chars (component, allowed_chars, encoding="utf-8")
 
 _remove_path_dot_segments (path)
 
 _normalize_host (host, scheme)
 
 _idna_encode (name)
 
 _encode_target (target)
 
 parse_url (url)
 
 get_host (url)
 

Variables

list url_attrs = ["scheme", "auth", "host", "port", "path", "query", "fragment"]
 
tuple NORMALIZABLE_SCHEMES = ("http", "https", None)
 
 PERCENT_RE = re.compile(r"%[a-fA-F0-9]{2}")
 
 SCHEME_RE = re.compile(r"^(?:[a-zA-Z][a-zA-Z0-9+-]*:|/)")
 
 URI_RE
 
str IPV4_PAT = r"(?:[0-9]{1,3}\.){3}[0-9]{1,3}"
 
str HEX_PAT = "[0-9A-Fa-f]{1,4}"
 
str LS32_PAT = "(?:{hex}:{hex}|{ipv4})".format(hex=HEX_PAT, ipv4=IPV4_PAT)
 
dict _subs = {"hex": HEX_PAT, "ls32": LS32_PAT}
 
list _variations
 
str UNRESERVED_PAT = r"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._\-~"
 
str IPV6_PAT = "(?:" + "|".join([x % _subs for x in _variations]) + ")"
 
str ZONE_ID_PAT = "(?:%25|%)(?:[" + UNRESERVED_PAT + "]|%[a-fA-F0-9]{2})+"
 
str IPV6_ADDRZ_PAT = r"\[" + IPV6_PAT + r"(?:" + ZONE_ID_PAT + r")?\]"
 
str REG_NAME_PAT = r"(?:[^\[\]%:/?#]|%[a-fA-F0-9]{2})*"
 
 TARGET_RE = re.compile(r"^(/[^?#]*)(?:\?([^#]*))?(?:#.*)?$")
 
 IPV4_RE = re.compile("^" + IPV4_PAT + "$")
 
 IPV6_RE = re.compile("^" + IPV6_PAT + "$")
 
 IPV6_ADDRZ_RE = re.compile("^" + IPV6_ADDRZ_PAT + "$")
 
 BRACELESS_IPV6_ADDRZ_RE = re.compile("^" + IPV6_ADDRZ_PAT[2:-2] + "$")
 
 ZONE_ID_RE = re.compile("(" + ZONE_ID_PAT + r")\]$")
 
tuple _HOST_PORT_PAT
 
 _HOST_PORT_RE = re.compile(_HOST_PORT_PAT, re.UNICODE | re.DOTALL)
 
 UNRESERVED_CHARS
 
 SUB_DELIM_CHARS = set("!$&'()*+,;=")
 
 USERINFO_CHARS = UNRESERVED_CHARS | SUB_DELIM_CHARS | {":"}
 
 PATH_CHARS = USERINFO_CHARS | {"@", "/"}
 
 QUERY_CHARS = PATH_CHARS | {"?"}