flyminos's picture
download
raw
404 Bytes
"""Regex utils"""
from __future__ import annotations
import re
RE_REPOSITORY = re.compile(
r"(?:(?:.*github.com.)|^)([A-Za-z0-9-]+\/[\w.-]+?)(?:(?:\.git)?|(?:[^\w.-].*)?)$"
)
def extract_repository_from_url(url: str) -> str | None:
"""Extract the owner/repo part form a URL."""
match = re.match(RE_REPOSITORY, url)
if not match:
return None
return match.group(1).lower()

Xet Storage Details

Size:
404 Bytes
·
Xet hash:
14a19be6295a7da264a087a456df5f6753b689b9c9672c8761af86ca32c4052e

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.