1from .split import urisplit 2 3# TODO: use specialized checks/regexes for performance 4 5 6def isuri(uristring): 7 """Return :const:`True` if `uristring` is a URI.""" 8 return urisplit(uristring).isuri() 9 10 11def isabsuri(uristring): 12 """Return :const:`True` if `uristring` is an absolute URI.""" 13 return urisplit(uristring).isabsuri() 14 15 16def isnetpath(uristring): 17 """Return :const:`True` if `uristring` is a network-path reference.""" 18 return urisplit(uristring).isnetpath() 19 20 21def isabspath(uristring): 22 """Return :const:`True` if `uristring` is an absolute-path reference.""" 23 return urisplit(uristring).isabspath() 24 25 26def isrelpath(uristring): 27 """Return :const:`True` if `uristring` is a relative-path reference.""" 28 return urisplit(uristring).isrelpath() 29 30 31def issamedoc(uristring): 32 """Return :const:`True` if `uristring` is a same-document reference.""" 33 return urisplit(uristring).issamedoc() 34