MCPcopy Create free account
hub / github.com/Freedium-cfd/web / is_valid_url

Function is_valid_url

medium-parser/medium_parser/utils.py:92–107  ·  view source on GitHub ↗

Check if the given URL is valid by verifying if it has a valid scheme and netloc. Parameters: url (str): The URL to be validated. Returns: bool: True if the URL is valid, False otherwise.

(url)

Source from the content-addressed store, hash-verified

90
91
92def is_valid_url(url):
93 """
94 Check if the given URL is valid by verifying if it has a valid scheme and netloc.
95
96 Parameters:
97 url (str): The URL to be validated.
98
99 Returns:
100 bool: True if the URL is valid, False otherwise.
101 """
102 fld = get_fld(url)
103 if not fld:
104 return False
105
106 parsed_url = urlparse(url)
107 return bool(parsed_url.scheme and parsed_url.netloc)
108
109
110def getting_percontage_of_match(string: str, matched_string: str) -> float:

Callers 1

resolve_urlMethod · 0.85

Calls 1

get_fldFunction · 0.85

Tested by

no test coverage detected