MCPcopy Create free account
hub / github.com/BraveOPotato/FckSignups / toAPIURL

Method toAPIURL

management_tools/githubBridge.py:15–26  ·  view source on GitHub ↗
(self, url)

Source from the content-addressed store, hash-verified

13 # @param {str} url - A GitHub repo URL
14 # @returns {str} url - A GitHub API URL
15 def toAPIURL(self, url):
16 parsed = urlparse(url)
17
18 path_parts = parsed.path.strip("/").split("/")
19 if len(path_parts) < 2:
20 raise ValueError("Invalid GitHub repository URL")
21
22 owner, repo = path_parts[0], path_parts[1]
23
24 api_url = f"https://api.github.com/repos/{owner}/{repo}"
25
26 return api_url
27
28
29# Abstraction to get the GitHub stars and license.

Callers 2

_queryRepoMethod · 0.80
_getAutomationStringMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected