hyperlink

Featureful, immutable, and correct URL handling library for Python

pipmacoslinuxwindows
Try with needOr install directly
Source

About

A featureful, immutable, and correct URL for Python.

Commands

hyperlink

Examples

Parse and manipulate URLs programmatically$ python3 -c "from hyperlink import URL; url = URL.from_text('https://example.com/path?key=value'); print(url.child('newpath'))"
Validate and normalize URL structures$ python3 -c "from hyperlink import URL; url = URL.from_text('https://example.com'); print(url.replace(path=['api', 'v1', 'users']))"
Extract and modify URL components$ python3 -c "from hyperlink import URL; url = URL.from_text('https://user:pass@example.com:8080/path'); print(f'Host: {url.host}, Port: {url.port}')"