(cls, url: str)
| 39 | |
| 40 | @classmethod |
| 41 | def from_url(cls, url: str) -> GitHub: |
| 42 | parsed = urlparse(url) |
| 43 | |
| 44 | if parsed.netloc != "github.com": |
| 45 | raise NoSuchRepository(url) |
| 46 | |
| 47 | paths = parsed.path.lstrip("/").split("/") |
| 48 | if len(paths) < 2: |
| 49 | raise NoSuchRepository(url) |
| 50 | |
| 51 | repo_name: str = paths[1] |
| 52 | |
| 53 | if repo_name.endswith(".git"): |
| 54 | repo_name = repo_name[:-4] |
| 55 | |
| 56 | return cls(owner=paths[0], repo_name=repo_name) |
| 57 | |
| 58 | @classmethod |
| 59 | def time_to_reset(cls) -> float: |