Skip to main content

'URL parser and manipulator based on the WHAT WG URL standard'

Project description

This is ada_url, a Python library for parsing and joining URLs.

WHATWG URL compliance

Unlike the standard library’s urllib.parse module, this library is compliant with the WHATWG URL spec.

urlstring = "https://www.GOoglé.com/./path/../path2/"

import ada_url

# prints www.xn--googl-fsa.com,
# the correctly parsed domain name according to WHATWG
print(ada_url.URL(urlstring).hostname)
# prints /path2/
# the correctly parsed pathname according to WHATWG
print(ada_url.URL(urlstring).pathname)

import urllib

#prints www.googlé.com
print(urllib.parse.urlparse(urlstring).hostname)
#prints /./path/../path2/
print(urllib.parse.urlparse(urlstring).path)

Examples

This package exposes a URL class that is intended to match the one described in the WHATWG URL spec.

>>> import ada_url
>>> ada_url.URL('https://example.org/path/../file.txt') as urlobj:
>>> urlobj.host = 'example.com'
>>> new_url = urlobj.href
>>> new_url
'https://example.com/file.txt'

It also provides some higher level functions for parsing and manipulating URLs.

>>> import ada_url
>>> ada_url.check_url('https://example.org')
True
>>> ada_url.join_url(
    'https://example.org/dir/child.txt', '../parent.txt'
)
'https://example.org/parent.txt'
>>> ada_url.normalize_url('https://example.org/dir/../parent.txt')
'https://example.org/parent.txt'
>>> ada_url.parse_url('https://user:pass@example.org:80/api?q=1#2')
{
    'href': 'https://user:pass@example.org:80/api?q=1#2',
    'username': 'user',
    'password': 'pass',
    'protocol': 'https:',
    'host': 'example.org:80',
    'port': '80',
    'hostname': 'example.org',
    'pathname': '/api',
    'search': '?q=1',
    'hash': '#2'
}
>>> ada_url.replace_url('http://example.org:80', protocol='https:')
'https://example.org/'

You can find more documentation at Read the Docs.

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

ada-url-1.0.0.tar.gz (374.2 kB view details)

Uploaded Source

Built Distributions

ada_url-1.0.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (596.2 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

ada_url-1.0.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl (541.0 kB view details)

Uploaded PyPy macOS 10.9+ x86-64

ada_url-1.0.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (596.2 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

ada_url-1.0.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl (541.0 kB view details)

Uploaded PyPy macOS 10.9+ x86-64

ada_url-1.0.0-cp311-cp311-musllinux_1_1_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

ada_url-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (637.5 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

ada_url-1.0.0-cp311-cp311-macosx_11_0_arm64.whl (382.0 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

ada_url-1.0.0-cp311-cp311-macosx_10_9_x86_64.whl (548.0 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

ada_url-1.0.0-cp311-cp311-macosx_10_9_universal2.whl (558.5 kB view details)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)

ada_url-1.0.0-cp310-cp310-musllinux_1_1_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

ada_url-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (637.5 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

ada_url-1.0.0-cp310-cp310-macosx_11_0_arm64.whl (382.0 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

ada_url-1.0.0-cp310-cp310-macosx_10_9_x86_64.whl (548.0 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

ada_url-1.0.0-cp310-cp310-macosx_10_9_universal2.whl (558.5 kB view details)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

ada_url-1.0.0-cp39-cp39-musllinux_1_1_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

ada_url-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (637.5 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

ada_url-1.0.0-cp39-cp39-macosx_11_0_arm64.whl (382.0 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

ada_url-1.0.0-cp39-cp39-macosx_10_9_x86_64.whl (548.0 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

ada_url-1.0.0-cp39-cp39-macosx_10_9_universal2.whl (558.4 kB view details)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)

ada_url-1.0.0-cp38-cp38-musllinux_1_1_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

ada_url-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (637.7 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

ada_url-1.0.0-cp38-cp38-macosx_11_0_arm64.whl (382.0 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

ada_url-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl (548.0 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

ada_url-1.0.0-cp38-cp38-macosx_10_9_universal2.whl (558.4 kB view details)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file ada-url-1.0.0.tar.gz.

File metadata

  • Download URL: ada-url-1.0.0.tar.gz
  • Upload date:
  • Size: 374.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for ada-url-1.0.0.tar.gz
Algorithm Hash digest
SHA256 87ae34dbea302f9034d4b644e0058113cef6d31d8aeaba40b28bcb139b85562f
MD5 37d5ebeb7b93ed3ba47b18e9d248dd7e
BLAKE2b-256 4e2f8b7d61d65c89735c303eaa834c87337a8d4173fd2b7e654404c6d909ddf9

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9bf0e6790cd4b2da1b2a4bae5bb217fa23b62b6b5e6f75d43386115df5d6fe00
MD5 27118a5bd73803ca582e2c1298c22d07
BLAKE2b-256 4c1ed8ddabea5e8047edcd766cbf592b33f8a640505550d1d25ea3387c772849

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5fb7f0bb10ebfe21eda9c593f5127dfcb26c1ffd5eb2063c1117fc3748de68c1
MD5 29e44612ea0f9f34830832448b2f1c7e
BLAKE2b-256 6e0c3bae296803f666be0965a7b89a2a21fe0a61efb2ce503ee978abe2382386

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c4abd65bffaf250e17f65f3fe63e049bb6d349a0b0ec32e7af5dfd67a084b224
MD5 b55719d4d9a37f5eb38a33b80694c669
BLAKE2b-256 5a719e1f1b5466a52dd7accac85c8ba2644ea0ae26eefaee6966c23dc5f82678

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9ccecd3ffa6eb0c21050bbdfd1409e76e4970fe6745fff8c2ff8bb089c2e3aef
MD5 216ea61b4012f243202a96a716dd5b46
BLAKE2b-256 22abca4d7868bdf2a7f70c0dfef7565362a95cb12fa9a3a7d5537bc0b5607158

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-cp311-cp311-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 7d2bf67a88d6c3d11ff681524ec191890cb739aadffaf4dee6ab35f73c6e04ca
MD5 c1114d76676115879f1bd423c6486dc1
BLAKE2b-256 538829e7aada9ec170b708c6a9af5bd1d35a3c634e82cad954197882d92463c0

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 57f8da546067273e5a5e9ebdff541d00399c21c682ddc841c1a127f9edcd5530
MD5 bb3ce819a60b9536fea807f569f32818
BLAKE2b-256 ffdffe9204ff74e295a1e3ca871eab410ef818d0ece7427a6a3bf1a6a30d7cb8

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 22d99a3f5ada88cc79f925d501760bb298e61f6920817a4e291d35cb88c7ebc6
MD5 70b5653a7c6761f042f1b603af9b60fe
BLAKE2b-256 5f269fac5afcd69b8003db1cc5d37e460e4662857a8392a97352664c094b3994

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 206d080788ca5dbb616a55ca9118af3496ebb335aa5864928b618a12eb8a5cc9
MD5 440f0ad1944124dc941ea68f1d8f01ef
BLAKE2b-256 6ed8aadf3c38a58810364e33e3b85b30485f96934bd09d4686d6af23e291923b

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 c707fcc61dd299fdde8d48ae114dce8e5719b3e9b24bcb1bfac1d89a2e210e08
MD5 5e08ba9932d5b0ae70d7a4a325ac4f3d
BLAKE2b-256 805057c20de1049da87df3f2d12fab7d7a6c7a0e84f5522ef4ff5f347d7ea2b7

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-cp310-cp310-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 ed43e2697d094a1b10e3220cf35deea6da09d588ebae8dacab18c2e503ed8d7d
MD5 bac5111c30f637d1eae42fef26f35f83
BLAKE2b-256 d90d3d05ec05dedab0de929804241dc3446d9e3919c3488852ff72c96767c5b2

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a0c437f5f7a6b83728eeeefdc8a258d5e9a0659989712f36b2a6fe22dca20764
MD5 2a07cd565a7b9f8e1a659415152fcba8
BLAKE2b-256 9d6f652876dfad469290f576919a59fa1eaa8cecf94c8877ced39f420995363a

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f79baa8cffee121f93cdc20b506b5e330782f31e6a4c4e3c87d7b1cb7eb7025c
MD5 e5f0db86e6eca2838455ee9e56c2aeed
BLAKE2b-256 ab3306e1646a7af67cee6160af8e64f1d54b68ed0e989df7c218f943507d2f54

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a42ddc5bd2ce0be7ded026c96c80b2f3bdaedeef061f2b3f62e3747b4250e884
MD5 31714fa646809d78190cb00e007125ad
BLAKE2b-256 68e4471e0433e9d183f7be427fd0fb1db1fef2f143a55d739b90141a5187c76e

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 1632fdede17afa5f8a61177161ebe9db6ab45ec4271de0d76ff2a34cda10f5aa
MD5 b8e3c5f73e006b41f2b19cb85d4af5b6
BLAKE2b-256 c71c75c8fadfb255c55d33afbbcf9249e41759c18108532fa24e8883e256a53f

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-cp39-cp39-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 1050d42dbfe9574fe7e02b4d5e34144137ceb4cdd7e2d35ab974a8e93e516a58
MD5 7983e431f160704312aede66f45fc020
BLAKE2b-256 4f4024a5581164302bb617788d9bb8dd70ab640b902e083eca59c943f1f89176

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 61964cc94cfdf51fa081d9b86d0d68832f237df1ed3b439179f5fc6971b26672
MD5 e669bfcf8a479bee87011b95a441ff90
BLAKE2b-256 81b24ece59eed6110d895cb348f51f651b4bd465e483a358aac0fbe67a5af152

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 14f9769be2671fd7acac667ce87ef42a200b0e4e391743a1c81ac50d9579a02e
MD5 898ba68027b558447b4a377b3795e7a1
BLAKE2b-256 243d3b12686d1f3d7a042d9d7c749803a8eb8fec7e920ba609dc08298e4ba9d6

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6f39a97a335713f0804fd6a2723b5f6193a1f950a6b3956be4f3cbfff8a2f44d
MD5 1ae73d7dff4d5e117b06b078c29848d9
BLAKE2b-256 5d8ce8b78fb22211c0599190df1aaceb52a8d3607a6d94b0945e2e0aa8dabf22

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 a7f567058af5ad2908fb7381f4bfed9905d43858ac0e8547730c9a83d8e839cd
MD5 9601aadc17bccdeab15ece6f438b1dd4
BLAKE2b-256 2a99db9078eee2c4416c04c2dc200a53fb940539fabe153603218ccdbc7bd094

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-cp38-cp38-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 39311b2ee2adeab5853a4ed030710163591af96d50f2de58b6194e65a6e7a2ad
MD5 87324bd8f8ad8518e26715848232467d
BLAKE2b-256 e9ea5bdc924c71490e65f7abc6ae8c94be09f2a4836932d71df503fa15e90811

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 444ae54a98a48caa22ac62eb1e705d4e0407a322aed60ccb7a9505fc53aa2286
MD5 89d7ad467a4aeeeb166316e0c068ab17
BLAKE2b-256 7493ea5512929c33e0fdf69d4a6312f899712bb355c11fc85933b070870a2b05

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e747c7595bda215a30f441651f1ec25088f6d5f45b58aed4dfc7876b70c5728d
MD5 265c9957c83240698cd57c68d31610b0
BLAKE2b-256 6ed37bb53a5b293cb785170bfecc854905ec8a1a341be3608b36dc87ec26f6be

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c01b5f4fc951f3710a071386be470a5bdef08f9bdd51051afb510036f6e88d90
MD5 479d90682605115d402eb6d3ebffb1b1
BLAKE2b-256 29f2e23c09512adfca1e45582a5313fa60e74242c56f892c5398b59f5630fa67

See more details on using hashes here.

File details

Details for the file ada_url-1.0.0-cp38-cp38-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for ada_url-1.0.0-cp38-cp38-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 44a7f647a64c64c06b5a56a8ae9952c05aa1e502f82f206e98e69f184cad4ca0
MD5 3029be858f0f627a253f5dc447735a04
BLAKE2b-256 3fff3cd11cc5fe529e89b8481ded119fd4e9d5e7dc53b018014f434517199063

See more details on using hashes here.

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