Check to see if a URL has a valid protocol. Parameters ---------- url : str or unicode Returns ------- isurl : bool If `url` has a valid protocol return True otherwise False.
(url: object)
| 153 | |
| 154 | |
| 155 | def is_url(url: object) -> bool: |
| 156 | """ |
| 157 | Check to see if a URL has a valid protocol. |
| 158 | |
| 159 | Parameters |
| 160 | ---------- |
| 161 | url : str or unicode |
| 162 | |
| 163 | Returns |
| 164 | ------- |
| 165 | isurl : bool |
| 166 | If `url` has a valid protocol return True otherwise False. |
| 167 | """ |
| 168 | if not isinstance(url, str): |
| 169 | return False |
| 170 | return parse_url(url).scheme in _VALID_URLS |
| 171 | |
| 172 | |
| 173 | @overload |
no outgoing calls
no test coverage detected