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.1.0.tar.gz (204.6 kB view details)

Uploaded Source

Built Distributions

ada_url-1.1.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (594.0 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

ada_url-1.1.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl (546.3 kB view details)

Uploaded PyPy macOS 10.9+ x86-64

ada_url-1.1.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (594.0 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

ada_url-1.1.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl (546.3 kB view details)

Uploaded PyPy macOS 10.9+ x86-64

ada_url-1.1.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.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (637.0 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

ada_url-1.1.0-cp311-cp311-macosx_11_0_arm64.whl (386.4 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

ada_url-1.1.0-cp311-cp311-macosx_10_9_x86_64.whl (554.0 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

ada_url-1.1.0-cp311-cp311-macosx_10_9_universal2.whl (565.2 kB view details)

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

ada_url-1.1.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.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (637.0 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

ada_url-1.1.0-cp310-cp310-macosx_11_0_arm64.whl (386.4 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

ada_url-1.1.0-cp310-cp310-macosx_10_9_x86_64.whl (554.0 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

ada_url-1.1.0-cp310-cp310-macosx_10_9_universal2.whl (565.1 kB view details)

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

ada_url-1.1.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.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (637.0 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

ada_url-1.1.0-cp39-cp39-macosx_11_0_arm64.whl (386.4 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

ada_url-1.1.0-cp39-cp39-macosx_10_9_x86_64.whl (554.0 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

ada_url-1.1.0-cp39-cp39-macosx_10_9_universal2.whl (565.1 kB view details)

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

ada_url-1.1.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.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (637.1 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

ada_url-1.1.0-cp38-cp38-macosx_11_0_arm64.whl (386.4 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

ada_url-1.1.0-cp38-cp38-macosx_10_9_x86_64.whl (554.0 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

ada_url-1.1.0-cp38-cp38-macosx_10_9_universal2.whl (565.1 kB view details)

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

File details

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

File metadata

  • Download URL: ada-url-1.1.0.tar.gz
  • Upload date:
  • Size: 204.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for ada-url-1.1.0.tar.gz
Algorithm Hash digest
SHA256 7ca5ca470be54ba76ef5b7c1f74040c8b4a44abe77ffa020ad59042dc68b4f96
MD5 631a5986df4a26564daa80e330d15d0d
BLAKE2b-256 9fa9823873265772137e6c662996d13fa1388bdbe23fca662343749a6d0068c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9da216e1170d648f3332773995d1dcf0f79493d5c91dce471919401f21fe3c3a
MD5 39b69044a621f63898defb495ff728f2
BLAKE2b-256 643b851fe7e2f1655dbdda9529edbfd635b3468bd820c65469fd57d40339469b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 01ab7621efeb87242e300b9146fcb290ea08deb0087e9abfd0c3726d54253071
MD5 b65a37b8e5b063533481b39a160666bc
BLAKE2b-256 1283e966be91709f0841c0ab82b4994f9d6b149bbae2245c9998dd0920e6dd3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f4a0a5307da7a42e92d97e6623a13c9bd2e0bc1cf18386d7a1dbe1b843c4a3d3
MD5 70aa234540738cd38d6e23c91cdcd881
BLAKE2b-256 b016c624649f85e15bf91745260d4011570a248e6cca12e5588aadf39c202a79

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 056f926b2ea1b2ba125499076ef48aaea1c669fa18b822d988c4b54cbb77c227
MD5 8e8153349f8635fe2f6f996956941105
BLAKE2b-256 3b730b25d19e696ae4ca44bee4278be07968e2b2a2e7f7dad2a3c1db7455dbb1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 b2bb2445b7adadf1483449c355c6415598c1f33938551b910cdd9b9f8b5e67f6
MD5 e93e09675a4d2935d755a34b866f0440
BLAKE2b-256 20ed0e87ec826ffec793029a43dd693cc03c27a92b41a543ab25b4b59010de73

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a8f0585fdc313490af9e1aa106bf159ba40ff3d1269ec28f3ff3a6ee5efc9d56
MD5 0a1d501c1e7fcc55c80b5c8ebc3475e7
BLAKE2b-256 61f0e4f8b264b3499f7b7ae729fb79c064944ad67930fdd6b8700d0feb2b447d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d6033c08bb77bb10b291bbb673d507a27eb50e9e4ab1cbacfed6c9936f80d942
MD5 11567d5077b621704b03f7350cca9b64
BLAKE2b-256 7ce7dfabf643553177b68898af1087f3aad4abe84d94dbd67299f12958d61a51

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b4c75f16c7d217930b1197f90438f98534e9aa8105166d2b512e9604c2c51659
MD5 be58be53c8f39bcafa985ffc96645fbf
BLAKE2b-256 238033187f22e5c4d8831b930399e44a284c80e71b607f01b0c132aebb37984e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 80a50bdd2b85907859eef32a4715f763fee0529f49477bff447715b0872a6add
MD5 4950d48fba2ff4e1b17b143cc72093c5
BLAKE2b-256 f78b5242a83d0267702db6371f0f647058b979031dafa14027f929afa8d40432

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 af098567fdbd52361c0820222645c9f1c562121091e190fe670e4f57dc632e44
MD5 49a1aa5f93f33fed53dbf4cce16cd0c4
BLAKE2b-256 e96718baf362a62bc4cb7f5ed7cc01b8c3a0ee7dd97ee6bb1733aabd88b73f84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 19d6fdee5ac7b7f037a0377d0f853f6a842de2a476c440c2a0af4d8d57571887
MD5 5c6a26e295a421a2843c46fef9cf9270
BLAKE2b-256 48a1cffa1906d34f3b95a752359a9ad5be73327a35f1f2681bc0d34f49980adb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 adff88676fc97723d7e8da1436c077505dc1ca1f591043f3de3a7bac9c013f00
MD5 3f2a4720e73e43aae8466ba0f3c67844
BLAKE2b-256 43670f018a7e4ac9d522a97190742d022597343a8bfd0e8ae320585585dd7142

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 142d53aaeb05c3f4184e940d7bac84ab726e71560f67b42f96bbbc8af5ecbc76
MD5 26e81d94ba92c55090bfbdeced488647
BLAKE2b-256 7a6068b2d7566a87eff2da5f1fd07cf76b30ccfc8363285818ca8855840406b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 efac0a756a204a833d60480728ecb8d452852d147c393b0206f04882fb6dedd8
MD5 f20412876bed3fbcc962ac0d364d8b89
BLAKE2b-256 eadd2d28e8b896c727c16667267c8a37f9c10f73514472945d09e322ace8a6c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 4f7f1040463714fb41ae73e635d40b17876df6ef5b2bbe2954119fcb89c229d0
MD5 0120db0880ecdcf9734fde81f184287a
BLAKE2b-256 0c99ebf289dfb9299f78e3046164533742d76cf1d7909c72bcf77efe7bfce751

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7062a84159b182d410fdea2c7014db6560f3f87eae6d871ad382edfc9379733f
MD5 d39581aed4eb5df8feb361faa689bba5
BLAKE2b-256 bea19b014d27ec519a12542c4d7195e6c595742b40cd7f831e2e3daf54e8648c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7d3c882c1f8a7ad3de00eec175f743b8571385b302fbf2bc83d6104948afd6cd
MD5 e0e577237235294297b4789beb43fd84
BLAKE2b-256 ead0a537c64a1dbb2cdd9264142f9791facf8ad455a230daf507c4181eb2b33f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a3d0abecf9503bd612eeaca5361a8553e85a68500fbaba297b6c9c925f4d6e84
MD5 ed275e5dacb770adca794efb3c7ae716
BLAKE2b-256 418b43fb9d4157a49054005a951bdb56701bc01b735b1ea5954b6ceaa1d048a1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 bb749531089ffbcc4dda6b5e6ae4d1a621be14c61cc98a4c5a7c5be4baaf065e
MD5 9620823905ac2fe1f9c12fe8123ef912
BLAKE2b-256 8b40be7ef3647ab5993c0c2a7448d2ec8ffa897aad1d2f247e7ea1f3015a2c4f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 bb7276a792231adced1152cd811d7961c4ce932346fc6c13141532b8f54302c3
MD5 8271bdd4c5194994aa8b9cb55041afae
BLAKE2b-256 8b39052327afff57ed8d71c02e922073ebcbaa308a727cf7d2077f04d192fb69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c90836c80623f2d03aa73f7d289c96f1b0ec885de80b0d45adae080b25363fd8
MD5 45ea4db6c7bda89eecfa8f9f504807f5
BLAKE2b-256 e884d97b50fea24248599f4640ccb0d75e1af817b055b41a54606a01a8672f8b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0b86025907220d0ffa8912e9c92d1c0df33422340514763e0001456cd506526c
MD5 c3e042010d773c4e42cd70411386d43e
BLAKE2b-256 529354a61e519a9d512c81f52b66ea748bc48b4ee5a658fa1547c531f0ff6b24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6efdbac16b3b0c9e26ad80c04582d0a7859880cde1163cbe1cc5962de0a19e12
MD5 5cb14c790b751310bf0e85c88f0cdf6e
BLAKE2b-256 7c6f1f99c95c17f419ba16ae292603f16cf9bcfcf6e94c5b71cda2a3b01bba95

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.1.0-cp38-cp38-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 69985c56358b3df36d91a0affc60a09b2cf2e9651fe3838d9e4c1a483251bed5
MD5 9591c7e9822ee91071bf48d77ae81572
BLAKE2b-256 16cde75c99549cb266632fde11c2007eff71427e5a8ac856ccf717487e70fe09

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