Skip to main content

Simple Pathlib-like usage of URLs

Project description

urlz

GitHub Workflow Status PyPI - Python Version PyPI

urlz is a simple URL parsing library that provides Pathlib-like usage to URLs in 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:

>>>> 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:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

urlz-0.1.2.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

urlz-0.1.2-py2.py3-none-any.whl (3.2 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page