Release history and notes¶
Sequence based identifiers are used for versioning (schema follows below):
major.minor[.revision]
- It’s always safe to upgrade within the same minor version (for example, from 0.3 to 0.3.4).
- Minor version changes might be backwards incompatible. Read the release notes carefully before upgrading (for example, when upgrading from 0.3.4 to 0.4).
- All backwards incompatible changes are mentioned in this document.
0.13¶
- Drop Python 2.7, 3.5 and 3.6 support. Minimum required version now is Python 3.7.
0.12.7¶
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.
0.12.6¶
2021-06-05
- Move
Registryclass fromtld.registrytotld.base. - Reformat code using
black. - Log information on updated resources of the
update_tld_names.
0.12.5¶
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).
0.12.3¶
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_tldandis_tldfunctions.
0.12.1¶
2020-04-25
Note
In commemoration of Armenian Genocide.
- Correctly handling domain names ending with dot(s).
0.11.7¶
2019-12-13
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.
0.11.4¶
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.
0.11¶
2019-12-09
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_urlandtld_names_local_pathintroduced in the previous release. - Minor speed-ups (including tests).
0.10¶
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_namesfunction withtld_names_local_pathparameter.
0.9.7¶
2019-10-30
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.
0.9.6¶
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.
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.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¶
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_onlyoption fromget_tld,get_fldandparse_urlfunctions. - Correctly handling exceptions (!) in the original TLD list.
- Fixes in documentation.
- Added
parse_tldfunction. - Fixes the
python setup.py testcommand.
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.
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')
- 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_publicandsearch_privatearguments accordingly. By default (to support old behavior), both are set toTrue. - Correct TLD definitions.
- Domains like *****.xn–fiqs8s are now recognized as well.
- Due to usage of
urlsplitinstead ofurlparse, the initial list of TLDs is assembled quicker (a speed-up of 15-20%). - Docs/ directory is included in source distribution tarball.
- More tests.
0.7.10¶
2018-04-07
- The
fix_protocolargument respects protocol relative URLs. - Change year in the license.
- Improved docstrings.
- TLD source updated to the latest version.
0.7.9¶
2017-05-02
- Added base path override for local .dat file.
- python setup.py test can used to execute the tests
0.7.8¶
2017-02-19
- Fix relative import in non-package for update-tls-names script. #15
get_tldgot a new argumentfix_protocol, which fixes the missing protocol, having prepended “https” if missing or incorrect.
0.7.7¶
2017-02-09
- Tested against Python 3.5, 3.6 and PyPy.
- pep8 fixes.
- removed deprecated tld.update module. Use
update-tld-namescommand instead.
0.7.3¶
2015-07-18
- Support for wheel packages.
- Fixed failure on some unicode domains.
- TLD source updated to the latest version.
- Documentation updated.
0.7¶
2014-08-14
- Making it possible to obtain object instead of just extracting the TLD by
setting the
as_objectargument ofget_tldfunction to True.
0.6.4¶
2014-05-21
- Softened dependencies and lowered the
sixpackage version requirement to 1.4.0. - Documentation improvements.