Install & Compatibility
Where this runs
tested against v1.2.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.8MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 2.1s · import 0.000s · 19MB
20MB installed
● package 20MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
parse
✓ from giturlparse import parse
✗ from git_url_parse import GitUrlParse
parser
✓ from giturlparse import parser
pbr
✓ from giturlparse import pbr
This quickstart demonstrates how to parse a common HTTPS Git URL and access its extracted components using the GitUrlParse class.
from git_url_parse import GitUrlParse
# Example 1: HTTPS URL
url = "https://github.com/retr0h/git-url-parse.git"
parsed_url = GitUrlParse().parse(url)
print(f"Host: {parsed_url.host}")
print(f"Owner: {parsed_url.owner}")
print(f"Repo: {parsed_url.repo}")
print(f"Protocol: {parsed_url.protocol}")
print(f"Name: {parsed_url.name}")
print(f"Token: {parsed_url.token}") # Empty for public URLs
Debug
Known issues
breakingThe v1.0.0 release introduced a significant breaking change, transitioning the API to a class-based approach. Older code that relied on direct function calls from the module root will no longer work.fixMigrate your parsing logic to use the `GitUrlParse().parse()` method. Consult the official documentation for the new API.
affects: <1.0.0
gotchaThe PyPI package name uses hyphens (`git-url-parse`), but the Python module name uses underscores (`git_url_parse`). Attempting to import with hyphens will result in a ModuleNotFoundError.fixAlways use `from git_url_parse import GitUrlParse` for importing.
affects: All versions
gotchaThe main parsing method, `parse()`, must be called on an instance of the `GitUrlParse` class. Directly calling `git_url_parse.parse()` (as a module-level function) will raise an `AttributeError`.fixInstantiate the class first: `parsed_url = GitUrlParse().parse(url)`.
affects: All versions >=1.0.0
gotchaWhile the GitHub repository for git-url-parse is actively maintained with recent commits, the official PyPI package (v1.2.2) has not been updated since September 2022. This means recent bug fixes or minor features in the `main` branch may not be available via `pip install`.fixFor the very latest features or unreleased bug fixes, consider installing directly from the GitHub repository: `pip install git+https://github.com/retr0h/git-url-parse.git`.
affects: 1.2.2 and later (for newer features/fixes)
Upgrade
Version history
1.2.2latest on PyPI · released Mar 23, 2019
Audit
Dependencies
No dependency data recorded yet.