MCPcopy
hub / github.com/opengeos/segment-geospatial / github_raw_url

Function github_raw_url

samgeo/common.py:77–89  ·  view source on GitHub ↗

Get the raw URL for a GitHub file. Args: url (str): The GitHub URL. Returns: str: The raw URL.

(url)

Source from the content-addressed store, hash-verified

75
76
77def github_raw_url(url):
78 """Get the raw URL for a GitHub file.
79
80 Args:
81 url (str): The GitHub URL.
82 Returns:
83 str: The raw URL.
84 """
85 if isinstance(url, str) and url.startswith("https://github.com/") and "blob" in url:
86 url = url.replace("github.com", "raw.githubusercontent.com").replace(
87 "blob/", ""
88 )
89 return url
90
91
92def download_file(

Callers 1

download_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected