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/'

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

Uploaded Source

Built Distributions

ada_url-0.1.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (596.1 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

ada_url-0.1.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl (540.8 kB view details)

Uploaded PyPy macOS 10.9+ x86-64

ada_url-0.1.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (596.1 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

ada_url-0.1.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl (540.8 kB view details)

Uploaded PyPy macOS 10.9+ x86-64

ada_url-0.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-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (637.4 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

ada_url-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (381.9 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

ada_url-0.1.0-cp311-cp311-macosx_10_9_x86_64.whl (547.9 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

ada_url-0.1.0-cp311-cp311-macosx_10_9_universal2.whl (558.3 kB view details)

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

ada_url-0.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-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (637.4 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

ada_url-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (381.9 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

ada_url-0.1.0-cp310-cp310-macosx_10_9_x86_64.whl (547.9 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

ada_url-0.1.0-cp310-cp310-macosx_10_9_universal2.whl (558.3 kB view details)

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

ada_url-0.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-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (637.4 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

ada_url-0.1.0-cp39-cp39-macosx_11_0_arm64.whl (381.9 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

ada_url-0.1.0-cp39-cp39-macosx_10_9_x86_64.whl (547.9 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

ada_url-0.1.0-cp39-cp39-macosx_10_9_universal2.whl (558.3 kB view details)

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

ada_url-0.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-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (637.5 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

ada_url-0.1.0-cp38-cp38-macosx_11_0_arm64.whl (381.9 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

ada_url-0.1.0-cp38-cp38-macosx_10_9_x86_64.whl (547.9 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

ada_url-0.1.0-cp38-cp38-macosx_10_9_universal2.whl (558.3 kB view details)

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

File details

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

File metadata

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

File hashes

Hashes for ada-url-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f39aa34508bebf2594d23c959e6e99b75a8bf0d8158a9ae400f4e6e1fff9b93f
MD5 037af53bbb0170e5217ae3cdce6dc6f4
BLAKE2b-256 85466c124665b00407d2e3867a5e6501b39d940eb0c16e379e95db80023501b6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0489fc924a4501025b272bb587018c298c105a5021e63b64984d5ec3cb855efb
MD5 df8604385cfde90f5003520f339fcb02
BLAKE2b-256 0c7f094e5aa23eaffc2c73de5f3a8f5cbb02979ca6a1e951b9063a5eb9b3bff0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6e449231ac9b66d5a13f7f1cdb60ad314f7734d60b2aadbd6a7c633ba52bcf89
MD5 8d55fc9d7f7874e695f52502fe2795de
BLAKE2b-256 2543334f0b620d60346a7d886f4f5de59337ee911216ecf01b9168880b4e69f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6206e66e6c35cfd9b1a154ca8a6e400e8e002e6bee5fc5cfb01703eed9c0b14d
MD5 5e3f7110f9de9e1042e624751eaa6f74
BLAKE2b-256 5e74abef43d0b1b022e6585345cb10ccd68eb2e0645f3a24d39013a371d3dc89

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d44b60e42169ee74265789ed5a1c7cd752a1a2e18c4f25b106ee0d910f241d9e
MD5 578d3bc78bd4612b98241f90a2e377ab
BLAKE2b-256 72f396a82b1a89de90e79d5980701df046c7aa4dae7bb03ab90495fc8141cb5b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 67d7898a72929d87ba7b1cc6610f0670e00bc3ad89df1ed1d35373efff53f561
MD5 15cb893bff460eca60ab9bcf924eaf93
BLAKE2b-256 e3baf27cab6c5ec40daafb7c8c610a8cb7ec675e955118cf1bc0d48783d2b6a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 53d4ba89ff8e79f79a9365e04100fe8149720eaea66bbe32553520d06320d6f7
MD5 4b212fb2d4a2b1f8080d8c10a7d07d0f
BLAKE2b-256 16a590d1c2113dcabd57134f9aac1fee2a534874f52f881baccaa2ba788d0106

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f899adc19f71cb73fcfdb0f45badf9270eea4d7d4d82cf358643b4319d7f16a0
MD5 f9bd852b5314b6f0f8b1ae2d6a5dc4df
BLAKE2b-256 1b0b385275a09ddb0f9fc08f73731286727eeff678eef9b366d207d25cdba595

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 80ce6410e5157c20cdde7e6ceec505ce80b737a557aa9753065bc6d062ea4427
MD5 452ad3b17970f7ce5ba2913c097eda7a
BLAKE2b-256 50603c000a49ed27ff9734ec899f8617067b948e694f232e52cfd7538cdd569e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 86c8a2aef747299ff96253ebe6c33584d398223671d9afb8deaec1d94d9caacb
MD5 17f0a0a816aef6d0a0d89d8237f7a7db
BLAKE2b-256 e18cc561fcbb9adb343d3b713903d0e5e850bdeb3226f4ff9cf773978b900c3a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 059d7ff1a9d822e5f86cd147e5e7685b6ea742ffd1298a3d47eef55509618622
MD5 2f27811056e909de17a39bead69d1701
BLAKE2b-256 7a5960b703f657b15c549481b251c110661eb0f7a124a2f7716c24138c2d9619

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8d03b61370b3d009cfdd942a7439a3112900a4aa7dd84c069f135c4b1cd7f90e
MD5 58a9b57442dc4abd0e55f8ce46f39b59
BLAKE2b-256 1853d3071d6aab7a57617c9b97caac353b41745f76e3003209d35879b26b6fa0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c1c2dd7d79f350384a762574b5b5ff4983c82493b220e479263e06e3d824b96e
MD5 304a7d24550010c575fec0e4ffb082ba
BLAKE2b-256 92cad31a9d7bef9b8bd55e6d1269de8a4a22567c66a52ce71277cbf8dff11173

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ac12bcd28997fdf874870775cc01387ed9119d52c24635cf6643588dd4c8bcab
MD5 fb8f89c8770b8adcc5885b8aa7bcd3f9
BLAKE2b-256 62b779ef3d853c29102884472179f4868fcee5898d9a18b8e79208cde9c5802b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 dc9d199c4435f28e12c052c23fa9e9a452860d1a44f1b134a091f604c04ff981
MD5 bb70c290f975f7698f98bc7e46bc3e93
BLAKE2b-256 6f9a2bfa674fef996a37dc55a1e52e6544776808910f2998efb8cd215392ef2f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 13bac086c449d4f9556555f5ec1b3b4260c842a1043d15fcfdd748923ef071e7
MD5 a3cd7ef07cb398a4a9eaa95fa264137d
BLAKE2b-256 a5dcea4cc9e6b1bf9e49915a33e295870b25b99c0a01418a72b71b590f26051c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 145f1d8e72eabd326697ba51a70d4e28a7ba5b46c7cd5a77a51cebf825b4ee70
MD5 056d5ec0fdd6b2f9a9e345e72edb32c5
BLAKE2b-256 e6d6574ec705bec4b496ed268894369af498d01ee0f05054dd51f4575d56d989

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 18f3d9aa1444607018d4b429e80e319ffe25679da02410900b0dc310cf23b342
MD5 707ea942c0aea224ddf614fbb95a9ef4
BLAKE2b-256 20236c62f675448b38f6cb69be3078de2cff165982ad6f6952c721a435bc5c0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 fe5299af343dd1af7dda9a60fadb4b385b2b8bb6f46e38989369c32102778ebb
MD5 013c0291d0ef3244f06e9bc44b2cd7e5
BLAKE2b-256 586ed3bfdab1920af7ec13e749a649e17d2c7a2a9ad13079a2b409f139036ba6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 301e04a7f42a325c87625d12afd36162dff2afc81593c19ba5fc8cd553e79142
MD5 c5b3366a1ab603c282b1b038bdb66215
BLAKE2b-256 a663d9b97e62831fd3d2f93dddad51278158dfd26ec59bdd5ed4bc4bafc31602

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 d15f3ae87728053ee9ebcc606c7af0058d83cc14ee1ccbec708c8d475c4a5e4f
MD5 07c893333c4a8c9c75417a8babd02c45
BLAKE2b-256 86ca4bc392df02b23badd9b953320879fa95ec7c68d02f8127b44ff468f82dc9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c03ae9d49835a6355f26dd1540b2d2b248ad37281bd5518abdbb6df722136217
MD5 92ea8f62629c22a2a30fe3811d689ebf
BLAKE2b-256 9496886181b2feafd62a27f0897dee167682bc8f78382acd3b2e0c8bce95fe01

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5ce0faac185b03e52b981782fec4ae66681a578689413d8b6c559865ca67affd
MD5 62e8cca95bce847316fa1a9ba142cf71
BLAKE2b-256 6ab42635a7cb3c60081edc6c76029fdd2542e55bf82056f0a06f4bcffd953b84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4601ad1362e30eb3dca7face6c405c802540cf3dc477e0c329eee30c8a5d46d4
MD5 0107aa6e66a0f368795d0548a8410bae
BLAKE2b-256 7846387d9fbf11890c5c3d144a1fda3d65c041956d3c45f4f59a3b3b4606e931

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-0.1.0-cp38-cp38-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 9aa1b62c2822b518c4792a3dd6839794c7ad71fd2464b6ec040247021f00b121
MD5 b6ee3b5d6abec0c71336cca8d85b9410
BLAKE2b-256 11b8654a0ce3c3a53ca8505b09229656d551ff3b4e8120c5ba00f85c483dfa55

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