Catalog PyPI
PACKAGE EXPLORERView in registry

ada-url

PyPI

URL parser and manipulator based on the WHAT WG URL standard

Versions collected1
Direct dependencies1From release 4.0.0
Last observed20 Oct, 19:10 UTC

README

Version 4.0.0 documentation
ada-url
========

This is ``ada_url``, a fast standard-compliant Python library for working with URLs based on the ``Ada`` URL
parser.

* `Documentation <https://ada-url.readthedocs.io>`__
* `Development <https://github.com/ada-url/ada-python/>`__
* `Ada <https://www.ada-url.com/>`__ 

Installation
------------

Install from `PyPI <https://pypi.org/project/ada-url/>`__:

.. code-block:: sh

    pip install ada_url

Usage examples
--------------

Parsing URLs
^^^^^^^^^^^^

The ``URL`` class is intended to match the one described in the
`WHATWG URL spec <https://url.spec.whatwg.org/#url-class>`_.

.. code-block:: python

    >>> from ada_url import URL
    >>> urlobj = URL('https://example.org/path/../file.txt')
    >>> urlobj.href
    'https://example.org/path/file.txt'

The ``parse_url`` function returns a dictionary of all URL elements:

.. code-block:: python

    >>> from ada_url import parse_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:',
        'port': '80',
        'hostname': 'example.org',
        'host': 'example.org:80',
        'pathname': '/api',
        'search': '?q=1',
        'hash': '#2',
        'origin': 'https://example.org:80',
        'host_type': <HostType.DEFAULT: 0>,
        'scheme_type': <SchemeType.HTTPS: 2>
    }

Altering URLs
^^^^^^^^^^^^^

Replacing URL components with the ``URL`` class:

.. code-block:: python

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

Replacing URL components with the ``replace_url`` function:

    >>> from ada_url import replace_url
    >>> replace_url('https://example.org/path/../file.txt', host='example.com')
    'https://example.com/file.txt'

Search parameters
^^^^^^^^^^^^^^^^^

The ``URLSearchParams`` class is intended to match the one described in the
`WHATWG URL spec <https://url.spec.whatwg.org/#interface-urlsearchparams>`__.

.. code-block:: python

    >>> from ada_url import URLSearchParams
    >>> obj = URLSearchParams('key1=value1&key2=value2')
    >>> list(obj.items())
    [('key1', 'value1'), ('key2', 'value2')]

The ``parse_search_params`` function returns a dictionary of search keys mapped to
value lists:

.. code-block:: python

    >>> from ada_url import parse_search_params
    >>> parse_search_params('key1=value1&key2=value2')
    {'key1': ['value1'], 'key2': ['value2']}

Internationalized domain names
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The ``idna`` class can encode and decode IDNs:

.. code-block:: python

    >>> from ada_url import idna
    >>> idna.encode('Bücher.example')
    b'xn--bcher-kva.example'
    >>> idna.decode(b'xn--bcher-kva.example')
    'bücher.example'

WHATWG URL compliance
---------------------

This library is compliant with the WHATWG URL spec. This means, among other things,
that it properly encodes IDNs and resolves paths:

.. code-block:: python

    >>> from ada_url import URL
    >>> parsed_url = URL('https://www.GOoglé.com/./path/../path2/')
    >>> parsed_url.hostname
    'www.xn--googl-fsa.com'
    >>> parsed_url.pathname
    '/path2/'

Contrast that with the Python standard library's ``urllib.parse`` module, which loosely
follows the older `RFC 3978 <https://datatracker.ietf.org/doc/html/rfc3978>`__ standard:

.. code-block:: python

    >>> from urllib.parse import urlparse
    >>> parsed_url = urlparse('https://www.GOoglé.com/./path/../path2/')
    >>> parsed_url.hostname
    'www.googlé.com'
    >>> parsed_url.path
    '/./path/../path2/'

Performance
-----------

This package uses `CFFI <https://github.com/ada-url/ada-python/>`__ to call
the ``Ada`` C library's functions, which makes it faster than the Python standard
library's ``urllib.parse`` module for most applications.

An alternative package, `can_ada <https://github.com/tktech/can_ada>`__, uses
`pybind11 <https://pybind11.readthedocs.io/en/stable/>`__ to interact with the ``Ada``
C++ library functions, which is even faster.

Downloads & popularity

28,654downloads
1-day window · source-reported counts19 Oct 2026
55K27.5K0
2026-07-22: 17,683 · observed 2026-10-20T19:41:40.8039656Z · period 2026-07-22–2026-07-222026-07-23: 16,400 · observed 2026-10-20T19:41:40.8039656Z · period 2026-07-23–2026-07-232026-07-24: 13,991 · observed 2026-10-20T19:41:40.8039656Z · period 2026-07-24–2026-07-242026-07-25: 5,870 · observed 2026-10-20T19:41:40.8039656Z · period 2026-07-25–2026-07-252026-07-26: 4,675 · observed 2026-10-20T19:41:40.8039656Z · period 2026-07-26–2026-07-262026-07-27: 18,985 · observed 2026-10-20T19:41:40.8039656Z · period 2026-07-27–2026-07-272026-07-28: 22,371 · observed 2026-10-20T19:41:40.8039656Z · period 2026-07-28–2026-07-282026-07-29: 18,527 · observed 2026-10-20T19:41:40.8039656Z · period 2026-07-29–2026-07-292026-07-30: 15,995 · observed 2026-10-20T19:41:40.8039656Z · period 2026-07-30–2026-07-302026-07-31: 19,093 · observed 2026-10-20T19:41:40.8039656Z · period 2026-07-31–2026-07-312026-08-01: 7,320 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-01–2026-08-012026-08-02: 3,149 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-02–2026-08-022026-08-03: 17,074 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-03–2026-08-032026-08-04: 21,211 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-04–2026-08-042026-08-05: 19,974 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-05–2026-08-052026-08-06: 17,146 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-06–2026-08-062026-08-07: 26,272 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-07–2026-08-072026-08-08: 6,393 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-08–2026-08-082026-08-09: 4,549 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-09–2026-08-092026-08-10: 21,843 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-10–2026-08-102026-08-11: 23,166 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-11–2026-08-112026-08-12: 17,871 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-12–2026-08-122026-08-13: 20,537 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-13–2026-08-132026-08-14: 17,194 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-14–2026-08-142026-08-15: 5,279 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-15–2026-08-152026-08-16: 4,347 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-16–2026-08-162026-08-17: 21,565 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-17–2026-08-172026-08-18: 29,525 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-18–2026-08-182026-08-19: 27,680 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-19–2026-08-192026-08-20: 24,683 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-20–2026-08-202026-08-21: 23,730 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-21–2026-08-212026-08-22: 7,632 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-22–2026-08-222026-08-23: 4,030 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-23–2026-08-232026-08-24: 17,642 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-24–2026-08-242026-08-25: 15,149 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-25–2026-08-252026-08-26: 13,239 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-26–2026-08-262026-08-27: 13,396 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-27–2026-08-272026-08-28: 14,334 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-28–2026-08-282026-08-29: 4,484 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-29–2026-08-292026-08-30: 3,945 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-30–2026-08-302026-08-31: 16,749 · observed 2026-10-20T19:41:40.8039656Z · period 2026-08-31–2026-08-312026-09-01: 22,923 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-01–2026-09-012026-09-02: 24,189 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-02–2026-09-022026-09-03: 54,987 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-03–2026-09-032026-09-04: 24,623 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-04–2026-09-042026-09-05: 22,355 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-05–2026-09-052026-09-06: 15,481 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-06–2026-09-062026-09-07: 18,514 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-07–2026-09-072026-09-08: 28,696 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-08–2026-09-082026-09-09: 15,984 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-09–2026-09-092026-09-10: 15,394 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-10–2026-09-102026-09-11: 18,066 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-11–2026-09-112026-09-12: 5,221 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-12–2026-09-122026-09-13: 3,702 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-13–2026-09-132026-09-14: 16,652 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-14–2026-09-142026-09-15: 20,015 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-15–2026-09-152026-09-16: 16,037 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-16–2026-09-162026-09-17: 17,862 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-17–2026-09-172026-09-18: 17,399 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-18–2026-09-182026-09-19: 7,671 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-19–2026-09-192026-09-20: 3,449 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-20–2026-09-202026-09-21: 12,912 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-21–2026-09-212026-09-22: 18,022 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-22–2026-09-222026-09-23: 19,154 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-23–2026-09-232026-09-24: 18,892 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-24–2026-09-242026-09-25: 19,819 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-25–2026-09-252026-09-26: 6,726 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-26–2026-09-262026-09-27: 6,145 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-27–2026-09-272026-09-28: 14,213 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-28–2026-09-282026-09-29: 16,028 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-29–2026-09-292026-09-30: 15,857 · observed 2026-10-20T19:41:40.8039656Z · period 2026-09-30–2026-09-302026-10-01: 18,314 · observed 2026-10-20T19:41:40.8039656Z · period 2026-10-01–2026-10-012026-10-02: 17,157 · observed 2026-10-20T19:41:40.8039656Z · period 2026-10-02–2026-10-022026-10-03: 5,623 · observed 2026-10-20T19:41:40.8039656Z · period 2026-10-03–2026-10-032026-10-04: 6,217 · observed 2026-10-20T19:41:40.8039656Z · period 2026-10-04–2026-10-042026-10-05: 15,346 · observed 2026-10-20T19:41:40.8039656Z · period 2026-10-05–2026-10-052026-10-06: 25,455 · observed 2026-10-20T19:41:40.8039656Z · period 2026-10-06–2026-10-062026-10-07: 24,255 · observed 2026-10-20T19:41:40.8039656Z · period 2026-10-07–2026-10-072026-10-08: 24,954 · observed 2026-10-20T19:41:40.8039656Z · period 2026-10-08–2026-10-082026-10-09: 18,225 · observed 2026-10-20T19:41:40.8039656Z · period 2026-10-09–2026-10-092026-10-10: 6,213 · observed 2026-10-20T19:41:40.8039656Z · period 2026-10-10–2026-10-102026-10-11: 6,395 · observed 2026-10-20T19:41:40.8039656Z · period 2026-10-11–2026-10-112026-10-12: 14,397 · observed 2026-10-20T19:41:40.8039656Z · period 2026-10-12–2026-10-122026-10-13: 28,830 · observed 2026-10-20T19:41:40.8039656Z · period 2026-10-13–2026-10-132026-10-14: 28,548 · observed 2026-10-20T19:41:40.8039656Z · period 2026-10-14–2026-10-142026-10-15: 23,982 · observed 2026-10-20T19:41:40.8039656Z · period 2026-10-15–2026-10-152026-10-16: 21,321 · observed 2026-10-20T19:41:40.8039656Z · period 2026-10-16–2026-10-162026-10-17: 9,728 · observed 2026-10-20T19:41:40.8039656Z · period 2026-10-17–2026-10-172026-10-18: 9,650 · observed 2026-10-20T19:41:40.8039656Z · period 2026-10-18–2026-10-182026-10-19: 28,654 · observed 2026-10-20T19:41:40.8039656Z · period 2026-10-19–2026-10-19
22 Jul19 Oct

pypistats · 90 observations shown. Missing days are unknown. Source category: overall: without mirrors.

View observed values
Date / source periodValueObserved at
2026-10-19 – 2026-10-1928,6542026-10-20T19:41:40.8039656Z
2026-10-18 – 2026-10-189,6502026-10-20T19:41:40.8039656Z
2026-10-17 – 2026-10-179,7282026-10-20T19:41:40.8039656Z
2026-10-16 – 2026-10-1621,3212026-10-20T19:41:40.8039656Z
2026-10-15 – 2026-10-1523,9822026-10-20T19:41:40.8039656Z
2026-10-14 – 2026-10-1428,5482026-10-20T19:41:40.8039656Z
2026-10-13 – 2026-10-1328,8302026-10-20T19:41:40.8039656Z
2026-10-12 – 2026-10-1214,3972026-10-20T19:41:40.8039656Z
2026-10-11 – 2026-10-116,3952026-10-20T19:41:40.8039656Z
2026-10-10 – 2026-10-106,2132026-10-20T19:41:40.8039656Z
2026-10-09 – 2026-10-0918,2252026-10-20T19:41:40.8039656Z
2026-10-08 – 2026-10-0824,9542026-10-20T19:41:40.8039656Z
2026-10-07 – 2026-10-0724,2552026-10-20T19:41:40.8039656Z
2026-10-06 – 2026-10-0625,4552026-10-20T19:41:40.8039656Z
2026-10-05 – 2026-10-0515,3462026-10-20T19:41:40.8039656Z
2026-10-04 – 2026-10-046,2172026-10-20T19:41:40.8039656Z
2026-10-03 – 2026-10-035,6232026-10-20T19:41:40.8039656Z
2026-10-02 – 2026-10-0217,1572026-10-20T19:41:40.8039656Z
2026-10-01 – 2026-10-0118,3142026-10-20T19:41:40.8039656Z
2026-09-30 – 2026-09-3015,8572026-10-20T19:41:40.8039656Z
2026-09-29 – 2026-09-2916,0282026-10-20T19:41:40.8039656Z
2026-09-28 – 2026-09-2814,2132026-10-20T19:41:40.8039656Z
2026-09-27 – 2026-09-276,1452026-10-20T19:41:40.8039656Z
2026-09-26 – 2026-09-266,7262026-10-20T19:41:40.8039656Z
2026-09-25 – 2026-09-2519,8192026-10-20T19:41:40.8039656Z
2026-09-24 – 2026-09-2418,8922026-10-20T19:41:40.8039656Z
2026-09-23 – 2026-09-2319,1542026-10-20T19:41:40.8039656Z
2026-09-22 – 2026-09-2218,0222026-10-20T19:41:40.8039656Z
2026-09-21 – 2026-09-2112,9122026-10-20T19:41:40.8039656Z
2026-09-20 – 2026-09-203,4492026-10-20T19:41:40.8039656Z
2026-09-19 – 2026-09-197,6712026-10-20T19:41:40.8039656Z
2026-09-18 – 2026-09-1817,3992026-10-20T19:41:40.8039656Z
2026-09-17 – 2026-09-1717,8622026-10-20T19:41:40.8039656Z
2026-09-16 – 2026-09-1616,0372026-10-20T19:41:40.8039656Z
2026-09-15 – 2026-09-1520,0152026-10-20T19:41:40.8039656Z
2026-09-14 – 2026-09-1416,6522026-10-20T19:41:40.8039656Z
2026-09-13 – 2026-09-133,7022026-10-20T19:41:40.8039656Z
2026-09-12 – 2026-09-125,2212026-10-20T19:41:40.8039656Z
2026-09-11 – 2026-09-1118,0662026-10-20T19:41:40.8039656Z
2026-09-10 – 2026-09-1015,3942026-10-20T19:41:40.8039656Z
2026-09-09 – 2026-09-0915,9842026-10-20T19:41:40.8039656Z
2026-09-08 – 2026-09-0828,6962026-10-20T19:41:40.8039656Z
2026-09-07 – 2026-09-0718,5142026-10-20T19:41:40.8039656Z
2026-09-06 – 2026-09-0615,4812026-10-20T19:41:40.8039656Z
2026-09-05 – 2026-09-0522,3552026-10-20T19:41:40.8039656Z
2026-09-04 – 2026-09-0424,6232026-10-20T19:41:40.8039656Z
2026-09-03 – 2026-09-0354,9872026-10-20T19:41:40.8039656Z
2026-09-02 – 2026-09-0224,1892026-10-20T19:41:40.8039656Z
2026-09-01 – 2026-09-0122,9232026-10-20T19:41:40.8039656Z
2026-08-31 – 2026-08-3116,7492026-10-20T19:41:40.8039656Z
2026-08-30 – 2026-08-303,9452026-10-20T19:41:40.8039656Z
2026-08-29 – 2026-08-294,4842026-10-20T19:41:40.8039656Z
2026-08-28 – 2026-08-2814,3342026-10-20T19:41:40.8039656Z
2026-08-27 – 2026-08-2713,3962026-10-20T19:41:40.8039656Z
2026-08-26 – 2026-08-2613,2392026-10-20T19:41:40.8039656Z
2026-08-25 – 2026-08-2515,1492026-10-20T19:41:40.8039656Z
2026-08-24 – 2026-08-2417,6422026-10-20T19:41:40.8039656Z
2026-08-23 – 2026-08-234,0302026-10-20T19:41:40.8039656Z
2026-08-22 – 2026-08-227,6322026-10-20T19:41:40.8039656Z
2026-08-21 – 2026-08-2123,7302026-10-20T19:41:40.8039656Z
2026-08-20 – 2026-08-2024,6832026-10-20T19:41:40.8039656Z
2026-08-19 – 2026-08-1927,6802026-10-20T19:41:40.8039656Z
2026-08-18 – 2026-08-1829,5252026-10-20T19:41:40.8039656Z
2026-08-17 – 2026-08-1721,5652026-10-20T19:41:40.8039656Z
2026-08-16 – 2026-08-164,3472026-10-20T19:41:40.8039656Z
2026-08-15 – 2026-08-155,2792026-10-20T19:41:40.8039656Z
2026-08-14 – 2026-08-1417,1942026-10-20T19:41:40.8039656Z
2026-08-13 – 2026-08-1320,5372026-10-20T19:41:40.8039656Z
2026-08-12 – 2026-08-1217,8712026-10-20T19:41:40.8039656Z
2026-08-11 – 2026-08-1123,1662026-10-20T19:41:40.8039656Z
2026-08-10 – 2026-08-1021,8432026-10-20T19:41:40.8039656Z
2026-08-09 – 2026-08-094,5492026-10-20T19:41:40.8039656Z
2026-08-08 – 2026-08-086,3932026-10-20T19:41:40.8039656Z
2026-08-07 – 2026-08-0726,2722026-10-20T19:41:40.8039656Z
2026-08-06 – 2026-08-0617,1462026-10-20T19:41:40.8039656Z
2026-08-05 – 2026-08-0519,9742026-10-20T19:41:40.8039656Z
2026-08-04 – 2026-08-0421,2112026-10-20T19:41:40.8039656Z
2026-08-03 – 2026-08-0317,0742026-10-20T19:41:40.8039656Z
2026-08-02 – 2026-08-023,1492026-10-20T19:41:40.8039656Z
2026-08-01 – 2026-08-017,3202026-10-20T19:41:40.8039656Z
2026-07-31 – 2026-07-3119,0932026-10-20T19:41:40.8039656Z
2026-07-30 – 2026-07-3015,9952026-10-20T19:41:40.8039656Z
2026-07-29 – 2026-07-2918,5272026-10-20T19:41:40.8039656Z
2026-07-28 – 2026-07-2822,3712026-10-20T19:41:40.8039656Z
2026-07-27 – 2026-07-2718,9852026-10-20T19:41:40.8039656Z
2026-07-26 – 2026-07-264,6752026-10-20T19:41:40.8039656Z
2026-07-25 – 2026-07-255,8702026-10-20T19:41:40.8039656Z
2026-07-24 – 2026-07-2413,9912026-10-20T19:41:40.8039656Z
2026-07-23 – 2026-07-2316,4002026-10-20T19:41:40.8039656Z
2026-07-22 – 2026-07-2217,6832026-10-20T19:41:40.8039656Z

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
4.0.028 Jul 20261

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
ada-url/ada-python

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:10 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:22084b1f5460d17ba9442aa4f3bdaf456422ffe56448eb34d49b73eeb5116ce3