https://github.com/steveberardi/urlz
simple Pathlib-like usage of URLs
https://github.com/steveberardi/urlz
python urlparser urls
Last synced: 2 days ago
JSON representation
simple Pathlib-like usage of URLs
- Host: GitHub
- URL: https://github.com/steveberardi/urlz
- Owner: steveberardi
- License: mit
- Created: 2023-01-07T15:53:35.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-30T14:35:29.000Z (over 3 years ago)
- Last Synced: 2026-02-22T21:59:24.748Z (3 months ago)
- Topics: python, urlparser, urls
- Language: Python
- Homepage:
- Size: 22.5 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# urlz



urlz is a simple URL parsing library that provides Pathlib-like usage to URLs in Python:
```python
>>>> from urlz import URL
>>>> url = URL("https://wordbrew.io")
>>>> str(url / "about" / "index.html")
'https://wordbrew.io/about/index.html'
```
It also provides a special URL-building function `urlify`:
```python
>>>> from urlz import urlify
>>>> urlify("https://wordbrew.io", "about", "index.html")
'https://wordbrew.io/about/index.html'
# with querystring params:
>>>> urlify("https://wordbrew.io", "search", params={"q": "hello world"})
'https://wordbrew.io/search?q=hello+world'
```
## Installation
```
pip install urlz
```
## TODO
- QS param helpers
- Path replacements (e.g. `url.replace(path="/new/stuff/")`)
- Validation helpers
## Alternatives
For more URL-parsing fun, check out these libraries:
- [furl](https://github.com/gruns/furl)
- [purl](https://github.com/codeinthehole/purl)
- [imurl](https://github.com/thesketh/imurl)