Skip to main content

Python URL Library

Project description

PythonSupport PyPI version

Documentation

A high-level Url class to make parsing, looking at and manipulating urls much easier.

Also allows for easily composable urls.

Everything is subject to change!

📄 Detailed Documentation | 🐍 PyPi

Getting Started

poetry install xurls

or

pip install xurls

Very basic example:

from xurls import Url

url = Url("http://www.google.com/some/path?some_key=some-value")
assert url.host == "www.google.com"

url.host = "apple.com"
assert str(url) == "http://apple.com/some/path"

assert url['some_key'] == 'some-value'

You can also compose urls:

from xurls import Url

base_url = Url(host='www.example.com')
url_to_append = Url(path='hello/today')

# Append url; paths will append to end, queries merged together.
# Other components like host will be replaced if there is a value in the appended url.
final_url = base_url.copy().append_url(url_to_append)

assert str(final_url) == 'www.example.com/hello/today'

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

xurls-1.4.1.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xurls-1.4.1-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file xurls-1.4.1.tar.gz.

File metadata

  • Download URL: xurls-1.4.1.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.12.4 Darwin/24.6.0

File hashes

Hashes for xurls-1.4.1.tar.gz
Algorithm Hash digest
SHA256 344117ce3197a6508008f1d84de8adf313093799d215f17d0934c48c2217ed8b
MD5 fd7765e82c8b1288681b92e6eb73bfab
BLAKE2b-256 a707f6ca89b3474a90b06527ac06d064cc84b383d92b6dfc67b39bf08dd1435b

See more details on using hashes here.

File details

Details for the file xurls-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: xurls-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.12.4 Darwin/24.6.0

File hashes

Hashes for xurls-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e04e07828939f698d73341352aff55cba56252a3dc840db9986b687996b90a58
MD5 015c2dfe7a25a374a15164e66aee4e6a
BLAKE2b-256 a996c4f93610bbe854de368c349a799ac1284b6c3f27e6a2eae570ddd3ccd34f

See more details on using hashes here.

Supported by

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