NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #906 most downloaded on PyPI
Extract the top-level domain (TLD) from the URL given.
Last release 7 months ago
06 Mar 2026
Ships unpredictably
gaps range from 9 days to 2.2 years
Nearly every release is documented
notes for 51 of 53 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
53 releases · first in 2013
Tested against Python 3.14 and 3.15.
2026-03-06
Full Changelog: 0.13...0.13.2
2026-03-06
Widen protol ranges and improve protocol matching in general.
Clean up.
Minor documentation fixes.
Tested against Python 3.14 and 3.15.
One column per quarter.
Updated some tests to reflect changes in tld names.
2025-05-20
Drop Python 2.7, 3.5 and 3.6 support. Minimum required version now is Python 3.7.
2023-02-28
Drop Python 2.7, 3.5 and 3.6 support. Minimum required version now is Python 3.7.
Make sure to fail silently on bad URL patterns.
2023-02-01
Make sure to fail silently on bad URL patterns.
Tested against Python 3.11.
Tested against Python 3.10.
Updated bundled tld names.
Move Registry class from tld.registry to tld.base.
Registry class from tld.registry to tld.base.black.update_tld_names.2021-06-05
Move Registry class from tld.registry to tld.base.
Reformat code using black.
Log information on updated resources of the update_tld_names.
` Release dedicated to defenders of Armenia and Artsakh (Nagorno Karabakh) and all the victims of Turkish and Azerbaijani aggression. `
Release dedicated to defenders of Armenia and Artsakh (Nagorno Karabakh)
and all the victims of Turkish and Azerbaijani aggression.
parsed_url attributes (SplitResult) when getting
tld as object (as_object=True).2021-01-11
Note
Release dedicated to defenders of Armenia and Artsakh (Nagorno Karabakh) and all the victims of Turkish and Azerbaijani aggression.
Fixed lower-cased parsed_url attributes (SplitResult) when getting tld as object (as_object=True).
2021-01-02 - Tested against Python 3.9.
2021-01-02
Tested against Python 3.9.
Separate parsers for (a) public and private and (b) public only domains. This fixes a bug. If you want an old behaviour:
Separate parsers for (a) public and private and (b) public only domains. This fixes a bug. If you want an old behaviour:
The following code would raise exception in past.
from tld import get_tld
get_tld(
'http://silly.cc.ua',
search_private=False
)
Now it would return ua.
get_tld(
'http://silly.cc.ua',
search_private=False
)
If you want old behavior, do as follows:
from tld.utils import MozillaTLDSourceParser
get_tld(
'http://silly.cc.ua',
search_private=False,
parser_class=MozillaTLDSourceParser
)
Same goes for get_fld, process_url, parse_tld and is_tld
functions.
2020-11-26
Separate parsers for (a) public and private and (b) public only domains. This fixes a bug. If you want an old behaviour:
The following code would raise exception in past.
from tld import get_tld
get_tld(
'http://silly.cc.ua',
search_private=False
)
Now it would return ua.
get_tld(
'http://silly.cc.ua',
search_private=False
)
If you want old behavior, do as follows:
from tld.utils import MozillaTLDSourceParser
get_tld(
'http://silly.cc.ua',
search_private=False,
parser_class=MozillaTLDSourceParser
)
Same goes for get_fld, process_url, parse_tld and is_tld functions.
- Add Mozilla license to dist. - Fix MyPy issues.
2020-05-20
Add mozilla license to dist.
Fix MyPy issues.
In commemoration of Armenian Genocide _.
2020-04-25
Note
In commemoration of Armenian Genocide.
Correctly handling domain names ending with dot(s).
Use Public Suffix list instead of deprecated Mozilla's MXR.
2020-04-19
Use Public Suffix list instead of deprecated Mozilla's MXR.
Minor speed-ups, reduce memory usage.
2020-02-05 - Python 2.7 and 3.5 fixes.
2020-02-05
Python 2.7 and 3.5 fixes.
Adding test TLDs list to the package.
Minor fixes in setup.py and manifest. Include missing resources for python 2.7 dist.
There have been no code changes since 0.11.2. The only change is that support for Python 2.7 and 3.5 has been added.
Note
There have been no code changes since 0.11.2. The only change is that support for Python 2.7 and 3.5 has been added.
Added support for Python 2.7.
Targeted releases for all supported Python versions.
2019-12-12
Targeted releases for all supported Python versions.
Targeted releases for all supported Python versions.
2019-12-12
Targeted releases for all supported Python versions.
Changed order of the releases (Python 3.6 and up come first, then Python 3.5).
2019-12-12
Changed order of the releases (Python 3.6 and up come first, then Python 3.5).
Make all distributions except Python 3.5 universal.
Added missing resources to the Python 3.5 release.
2019-12-12
Added missing resources to the Python 3.5 release.
2019-12-12 - Bring back Python 3.5 support.
2019-12-12
Bring back Python 3.5 support.
- Minor speed ups. - More on adding typing.
Since introduction of parser classes, usage of NAMES_SOURCE_URL and NAMES_LOCAL_PATH of the tld.conf module is deprecated. Also, tld_names_local_path…
Note
Since introduction of parser classes, usage of NAMES_SOURCE_URL and NAMES_LOCAL_PATH of the tld.conf module is deprecated. Also, tld_names_local_path and tld_names_source_url arguments are deprecated as well. If you want to customise things, implement your own parser (inherit from BaseTLDSourceParser).
Drop support for Python versions prior to 3.6.
Clean-up dependencies.
Introduce parsers.
Drop tld_names_source_url and tld_names_local_path introduced in the previous release.
Minor speed-ups (including tests).
This is the last release which supports Python 2.
Note
This is the last release which supports Python 2.
Make it possible to provide a custom path to the TLD names file.
Make it possible to free up some resources occupied due to loading custom tld names by calling the reset_tld_names function with tld_names_local_path parameter.
2019-11-27
Note
This is the last release to support Python 2.
Make it possible to provide a custom path to the TLD names file.
Make it possible to free up some resources occupied due to loading custom tld names by calling the reset_tld_names function with tld_names_local_path parameter.
Fix for occasional issue when some domains are not correctly recognised.
2019-11-15
Fix for occasional issue when some domains are not correctly recognised.
This release is dedicated to my newborn daughter. Happy birthday, my dear Ani.
Note
This release is dedicated to my newborn daughter. Happy birthday, my dear Ani.
Handling urls that are only a TLD.
Accepts already splitted URLs.
Tested against Python 3.8.
Fix for update-tld-names returns a non-zero exit code on success (introduced with optimisations in 0.9.4).
2019-09-12
Fix for update-tld-names returns a non-zero exit code on success (introduced with optimisations in 0.9.4).
Minor tests improvements.
2019-09-11 - Tests improvements.
2019-09-11
Tests improvements.
Optimisations in setup.py, tests and console scripts.
2019-09-11
Optimisations in setup.py, tests and console scripts.
Skip testing the update-tld-names functionality if no internet is available.
- Added is_tld function. - Docs updated. - Upgraded test suite.
2019-04-05
Added is_tld function.
Docs updated.
Upgrade test suite.
Fix an issue causing certain punycode TLDs to be deemed invalid.
Correctly handling nested TLDs.
``` This release contains backward incompatible changes. You should update your code.
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.
active_only option from get_tld, get_fld
and parse_url functions.parse_tld function.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.
This release contains backward incompatible changes. You should update your code.
This release contains backward incompatible changes. You should update
your code.
Old ``get_tld`` functionality remain is moved to ``get_fld`` (first-level
domain definition). The ``as_object`` argument (False by default) has been
deprecated for ``get_fld``.
res = get_tld("http://www.google.co.uk", as_object=True)
**Old behaviour**
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**
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:
# Old
from tld import get_tld
get_tld('http://google.co.uk')
# New
from tld import get_fld
get_fld('http://google.co.uk')
search_public and search_private arguments accordingly.
By default (to support old behavior), both are set to True.*****.xn--fiqs8s are now recognized as well.urlsplit instead of urlparse, the initial list of TLDs
is assembled quicker (a speed-up of 15-20%).The fix_protocol argument respects protocol relative URLs.
fix_protocol argument respects protocol relative URLs.2018-04-07
The fix_protocol argument respects protocol relative URLs.
Change year in the license.
Improved docstrings.
TLD source updated to the latest version.
Added base path override for local .dat file.
python setup.py test can used to execute the tests.2017-05-02
Added base path override for local .dat file.
python setup.py test can used to execute the tests
Fix relative import in non-package for update-tls-names script. #15
get_tld got a new argument fix_protocol, which fixes the missing
protocol, having prepended "https" if missing or incorrect.removed deprecated tld.update module. Use update-tld-names command instead.
tld.update module. Use update-tld-names command
instead.2017-02-09
Tested against Python 3.5, 3.6 and PyPy.
pep8 fixes.
removed deprecated tld.update module. Use update-tld-names command instead.
2016-01-23 - Minor fixes.
2016-01-23
Minor fixes.
Updated tld names file to the latest version.
2015-11-22
Minor fixes.
Updated tld names file to the latest version.
Exposed TLD initialization as get_tld_names.
get_tld_names.2015-09-24
Exposed TLD initialization as get_tld_names.
Fixed failure on some unicode domains.
2015-07-18
Support for wheel packages.
Fixed failure on some unicode domains.
TLD source updated to the latest version.
Documentation updated.
2014-09-28 - Minor fixes.
2014-09-28
Minor fixes.
Force lower case of the URL for correct search.
2014-09-23
Force lower case of the URL for correct search.
Making it possible to obtain object instead of just extracting the TLD by setting the as_object argument of get_tld function to True.
as_object argument of get_tld function to True.2014-08-14
Making it possible to obtain object instead of just extracting the TLD by setting the as_object argument of get_tld function to True.
Softened dependencies and lowered the six package version requirement to 1.4.0.
six package version requirement to
1.4.0.2014-05-21
Softened dependencies and lowered the six package version requirement to 1.4.0.
Documentation improvements.
2013-12-05 - Speed up search
2013-12-05
Speed up search
Fix for URLs with a port not handled correctly.
2013-12-03
Fix for URLs with a port not handled correctly.
Adding licenses.
- Minor fixes. - Credits added.
2013-09-13 - Python 3 support added.
2013-09-13
Python 3 support added.
- Tiny code improvements. - Tests added.
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →