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

Uploaded Source

Built Distributions

ada_url-1.2.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (596.8 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

ada_url-1.2.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl (550.2 kB view details)

Uploaded PyPy macOS 10.9+ x86-64

ada_url-1.2.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (596.8 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

ada_url-1.2.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl (550.2 kB view details)

Uploaded PyPy macOS 10.9+ x86-64

ada_url-1.2.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.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (643.3 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

ada_url-1.2.0-cp311-cp311-macosx_11_0_arm64.whl (390.0 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

ada_url-1.2.0-cp311-cp311-macosx_10_9_x86_64.whl (558.5 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

ada_url-1.2.0-cp311-cp311-macosx_10_9_universal2.whl (570.4 kB view details)

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

ada_url-1.2.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.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (643.3 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

ada_url-1.2.0-cp310-cp310-macosx_11_0_arm64.whl (390.0 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

ada_url-1.2.0-cp310-cp310-macosx_10_9_x86_64.whl (558.5 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

ada_url-1.2.0-cp310-cp310-macosx_10_9_universal2.whl (570.4 kB view details)

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

ada_url-1.2.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.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (643.3 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

ada_url-1.2.0-cp39-cp39-macosx_11_0_arm64.whl (390.0 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

ada_url-1.2.0-cp39-cp39-macosx_10_9_x86_64.whl (558.5 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

ada_url-1.2.0-cp39-cp39-macosx_10_9_universal2.whl (570.4 kB view details)

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

ada_url-1.2.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.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (643.5 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

ada_url-1.2.0-cp38-cp38-macosx_11_0_arm64.whl (390.0 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

ada_url-1.2.0-cp38-cp38-macosx_10_9_x86_64.whl (558.5 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

ada_url-1.2.0-cp38-cp38-macosx_10_9_universal2.whl (570.4 kB view details)

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

File details

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

File metadata

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

File hashes

Hashes for ada-url-1.2.0.tar.gz
Algorithm Hash digest
SHA256 2027c903dbcc7843a9d46c1727dca233fe4d0171da013ce7937c187a885e29a1
MD5 a0e6763eafbe3619a24631483a9ed1f4
BLAKE2b-256 cc453c6c0c6fb0fd8e37e229e958ebab229be9163620faebfa008c940bd6024a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 45a1cae0a5de1c4beba54a6c68756206081da36d57a96de1b1d37c3dcda48e3c
MD5 f2779509b540109a8084d31a1a1f76ec
BLAKE2b-256 6106751a8839747ac8faab761334cf719b7067bc502a110b72edd4f7fd09835c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7501d6af5e33b1477c1651a16ca7e64b9572b96da4069726ad0a2776c59f0679
MD5 ae8e5ae5e1908e8ee0accfc196932b6b
BLAKE2b-256 6b34914578b49c12df8c5c3362534e7a688ffa23cf10d33a5be94094e91f1aa9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7889ba6647517f28185b2bd82fe61160b21c690e5926215c6e5af0868811cd30
MD5 ad4de9602d82fc7b3e2d1c931b211b92
BLAKE2b-256 298f8e393dd6a8aa2842875efb7bbfa8602d795f53763fc0da8e39b7b8777bda

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 91eed4b917d3a8b06a29d4bc57ca794359a992b088544107ab046c083e44efe6
MD5 d57ec8e74ecf726a3a522815ee498b89
BLAKE2b-256 ccf74b405c3a87735786b46d27c898306cfee00751fa75eed08ac7057dd6e2ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 fa70dd17578bbf321e2d00a1d7093634166ae4c8dfcfff03fb0eded185b652ac
MD5 9707765e03c9e74a057301f07d944a53
BLAKE2b-256 c4e80639e497ef87f17dfd8af9ec20e51fa819e0101ad3a174d9231c7225a5e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 09bef878dc58746811693d0375263995a35ceb3aa86bee3ddccc9ffea1aaa662
MD5 bc5dcdd2ef0d97a720c055e9d7624fb3
BLAKE2b-256 29b7480ec2573d7bf710123619f22781dad7133872bf38fc101f3ec1216e6de3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fb5077e8538d1425c6131a26767352ca545e181fc4af3e67af0d8050ffee6d48
MD5 007a22aafb14a4df0a9481698cf7f22d
BLAKE2b-256 a2009d8dd748e34ca52aff310549d18108bdfddb64c1d95b3c26871abcee24cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1a905a991a63ba170c4d7844323ef9fa2216680b652655372f2e83be9ce8a253
MD5 de03010e86a3795c4c6f408adacb0841
BLAKE2b-256 fabc24a9b7b202b1bf9e58915bfc3c657b0d7b824814af7f0e50c1068d9d20cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 64e7d9723637d67fcddee8d0d808256ae0a0b277183e2eaea3caa3d70ce33acd
MD5 ebaac7276f74e28260ba0facec9062d1
BLAKE2b-256 664fa175530e186e66cebc0ec64f23eb567caec5501cd8f04104a32e9be2162a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 3b9b570fbaee3d663aaa6eaae76666f2eb030a799b10d602a11fb26b28875096
MD5 1c769791b407a00a1ad644aabd28a30d
BLAKE2b-256 2b3f82845ce716eb635bab57d2032f37e81c88be21486d9c9fbeef01fbaef205

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 afebe5a541784f9fc16195b58e529c9b9231fa94d442cc29b549b5d6e01201e1
MD5 afb5283024004502a12d5bfcb623d32b
BLAKE2b-256 f91a3c691bd3009ad79a732a801bc095635ba52c3a04eed2c57bcc8bb10c2656

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 93d228c4644fbac6ace56a71a5421f8498727eeb96397a17c6aca8ac86e0dde9
MD5 6954961eb321b1e69d0971e0ad0c67f1
BLAKE2b-256 44f2065684660c892e962e26f96b5c60bd87ba0859b6f5f455ff7a49fc41dcd9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 354a368d42cdf23ff726ca1658a564cd2995f9b2dc5ad7ac15cc3a094bcadd2e
MD5 433951e2493a9dec245ddcf449b550ff
BLAKE2b-256 665d1ea8b0198ae9ed4498fce5f2e4e5fdb5501442576ccbe33fdf000fc22b40

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 725f27ac9cb43b98f6e14745f074ed0bb49339c2bfd555fca6429b23c564645b
MD5 5c0b30ed5c7fd161ec62de2435f71288
BLAKE2b-256 8753b9983eea9f7f92ec3987cc4299e016d01ba5385c68c11564823a22b6cdf7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 ae5623b43e8cbeeb04638a786b836c8db5961904eabd1475e78b7ad1b9657014
MD5 2e001b00b4cbe46baf046c430fa19520
BLAKE2b-256 8b000b6cc5d58892cc61f4ce5a7d57d26df650228b906de65d8f60f99aa842ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9945a0d4c987958bffcc60813ecd9627d31d1e5ff8b5f99fe3ee110536d4b196
MD5 30b3177f1c75525c815e20b397bde621
BLAKE2b-256 3dfb2bb2e25319d495667580742ab2a7a8a8e81d70a450238812f06ce806fe8c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ba66918233e79bfa6e8e148bbb79004795d0e9f7bbe956299b3f0e2b652bd69a
MD5 a20aebb2cd4925ca201c85a1b8b39ed7
BLAKE2b-256 8b46626d3e8320c7612bb9fe9b0b5ee1f21f50f042a405542985fa6ea6eaa09e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a479170988ccc11da06989bd2f67cb5d8427dadfc1231cea8507e1ed240708ef
MD5 5bbcdef36adceb8e62ddf1daaa252055
BLAKE2b-256 7b0ea54a11ce56058f5b4666655dc85eb604ed83d4e38fdde98fa6258f72d442

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 7ac9204940cdef5edef7a6acae03a337a45687a5fca819a4cee6d6b8360ff270
MD5 ae7a161a264baf58e6fb7bb83d6ed6e2
BLAKE2b-256 6388e11d40f02d793182e7aa83b96fb33044319e1fc27a9543bd550eefe1941f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 62acb40446de52c145706e021edb91deb4536dd43d9d22eba520a8f82fd986cb
MD5 0970e5969dc17ac23d31b3f467d7faf0
BLAKE2b-256 4ceef2d6ae8c3d27246db3d78be1cb0d2ccaa33d9320a1cbf1cb1e8178851ff6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 43dd22579fc32c129270ac96d48da850af1485684538330a93ab8de2c08b8acd
MD5 040d1ed322c276b727606565d2a0131a
BLAKE2b-256 eb0ef12735c4e509a5b9e7d9c4e9663918aeda38b33ee4b7e50cb37bd3f4fe64

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a17d3f84d88adb1348394092b1d8fdc2a46f19c1d373f36570e42f2ad7bd9105
MD5 89e081d9b96333e798d7a02943ea19cc
BLAKE2b-256 eff78caeeea303b668f140ca7e7a63a5d1b6426b156190b60427a88c59965373

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0c3a33baea0d1c87ffe734657f05bb149d2a5f6ddbb83cd7f284772deae35b1e
MD5 a511e3e890cd44b7a3784c0cb5e722bd
BLAKE2b-256 8f49e839f266244310ea5e4d64170eaa29d80e6a1ffc80cb3d3b4313ce4f7fb3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ada_url-1.2.0-cp38-cp38-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 31acc4a4ca04ee6ebae43aff8ee75bf59ee6bee60039ccfbf639e587eae1d108
MD5 67a90c6cab35db1005e82b5d7923b492
BLAKE2b-256 dd7223cae846ce947c3aa0ae4667a423d7c47a5dd1281a10b03d633259c3bdbb

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