Tld

Latest version: v0.12.7

Safety actively analyzes 629639 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 8

0.9.4

-----
2019-09-11

- Optimisations in setup.py, tests and console scripts.
- Skip testing the update-tld-names functionality if no internet is available.

0.9.3

-----
2019-04-05

- Added `is_tld` function.
- Docs updated.
- Upgrade test suite.

0.9.2

-----
2019-01-10

- Fix an issue causing certain punycode TLDs to be deemed invalid.
- Tested against Python 3.7.
- Added tests for commands.
- Dropped Python 2.6 support.
- TLD source updated to the latest version.

0.9.1

-----
2018-07-09

- Correctly handling nested TLDs.

0.9

---
2018-06-14

.. note::

This release contains backward incompatible changes. You should update
your code.

The ``active_only`` option has been removed from ``get_tld``, ``get_fld``
and ``parse_url`` functions. Update your code accordingly.

- Removed ``active_only`` option from ``get_tld``, ``get_fld``
and ``parse_url`` functions.
- Correctly handling exceptions (!) in the original TLD list.
- Fixes in documentation.
- Added ``parse_tld`` function.
- Fixes the ``python setup.py test`` command.

0.8

---
2018-06-13

.. note::

This release contains backward incompatible changes. You should update
your code.

Old ``get_tld`` functionality is moved to ``get_fld`` (first-level
domain definition). The ``as_object`` argument (False by default) has been
deprecated for ``get_fld``.

.. code-block:: python

res = get_tld("http://www.google.co.uk", as_object=True)

**Old behaviour**

.. code-block:: text

In: res.domain
Out: 'google'

In: res.extension
Out: 'co.uk'

In: res.subdomain
Out: 'www'

In: res.suffix
Out: 'co.uk'

In: res.tld
Out: 'google.co.uk'

**New behaviour**

.. code-block:: text

In: res.fld
Out: 'google.co.uk'

In: res.tld
Out: 'co.uk'

In: res.domain
Out: 'google'

In: res.subdomain
Out: 'www'

When used without ``as_object`` it returns ``co.uk``.

**Recap**

If you have been happily using old version of ``get_tld`` function without
``as_object`` argument set to ``True``, you might want to replace ``get_tld``
import with ``get_fld`` import:

.. code-block:: python

Old
from tld import get_tld
get_tld('http://google.co.uk')

New
from tld import get_fld
get_fld('http://google.co.uk')

- Move to a Trie to match TLDs. This brings a speed up of 15-20%.
- It's now possible to search in public, private or all suffixes (old
behaviour). Use ``search_public`` and ``search_private`` arguments accordingly.
By default (to support old behavior), both are set to True.
- Correct TLD definitions.
- Domains like `*****.xn--fiqs8s` are now recognized as well.
- Due to usage of ``urlsplit`` instead of ``urlparse``, the initial list of TLDs
is assembled quicker (a speed-up of 15-20%).
- Docs/ directory is included in source distribution tarball.
- More tests.

Page 5 of 8

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.