is_url
- pyhelpers.ops.is_url(url, partially=False)[source]
Check whether
url
is a valid URL.See also [OPS-IU-1]
- Parameters:
url (str) – a string-type variable
partially (bool) – whether to consider the input as partially valid, defaults to
False
- Returns:
whether
url
is a valid URL- Return type:
bool
Examples:
>>> from pyhelpers.ops import is_url >>> is_url(url='https://github.com/mikeqfu/pyhelpers') True >>> is_url(url='github.com/mikeqfu/pyhelpers') False >>> is_url(url='github.com/mikeqfu/pyhelpers', partially=True) True >>> is_url(url='github.com') False >>> is_url(url='github.com', partially=True) True >>> is_url(url='github', partially=True) False