MCPcopy
hub / github.com/vinta/awesome-python / extract_github_repos

Function extract_github_repos

website/fetch_github_stars.py:29–36  ·  view source on GitHub ↗

Extract unique owner/repo pairs from GitHub URLs in markdown text.

(text: str)

Source from the content-addressed store, hash-verified

27
28
29def extract_github_repos(text: str) -> set[str]:
30 """Extract unique owner/repo pairs from GitHub URLs in markdown text."""
31 repos = set()
32 for url in re.findall(r"https?://github\.com/[^\s)\]]+", text):
33 repo = extract_github_repo(url.split("#")[0].rstrip("/"))
34 if repo:
35 repos.add(repo)
36 return repos
37
38
39def save_cache(cache: dict) -> None:

Callers 5

test_multiple_reposMethod · 0.90
test_deduplicatesMethod · 0.90
test_strips_fragmentMethod · 0.90
mainFunction · 0.85

Calls 1

extract_github_repoFunction · 0.90

Tested by 4

test_multiple_reposMethod · 0.72
test_deduplicatesMethod · 0.72
test_strips_fragmentMethod · 0.72