After upgrading, update your cache file by deleting it or via tldextract --update
.
- Bugfixes
- Documentation
- Clarify how to use your own definitions
- Clarify first-successful definitions vs. merged definitions
- Misc.
- Bugfixes
- Misc.
- Bugfixes
- Fix path join on Windows (#314)
- Support Python 3.12
- Features
- Docs
- Improve clarity of absolute path (#312)
- Misc.
- Extract all testing deps from tox.ini to pyproject.toml extras (#310)
- Work around responses type union error, in tests
- Bugfixes
- Indicate MD5 not used in a security context (FIPS compliance) (#309)
- Misc.
- Increase typecheck aggression
- Breaking Changes
- Migrate
ExtractResult
fromnamedtuple
todataclass
(#306)-
This means no more iterating/indexing/slicing/unpacking the result object returned by this library. It is no longer a tuple. You must directly reference the fields you're interested in.
For example, the following will no longer work.
tldextract.extract("example.com")[1:3] # TypeError: 'ExtractResult' object is not subscriptable
Instead, use the following.
ext = tldextract.extract("example.com") (ext.domain, ext.suffix)
-
- Migrate
- Bugfixes
- Drop support for EOL Python 3.7
- Misc.
- Switch from pycodestyle and Pylint to Ruff (#304)
- Consolidate config files
- Type tests
- Require docstrings in tests
- Remove obsolete tests
- Breaking bugfixes
- Always include suffix if private suffix enabled and private suffix exists (#300)
- Add a 4th field
is_private: bool
, to theExtractResult
namedtuple
, indicating whether the extraction came from the PSL's private domains or not. - This could cause issues when iterating over the tuple and assuming only 3 fields.
- Previously, the docs promoted iteration to rejoin parts of the tuple.
This is better achieved by individual access of fields of interest
(e.g.
ExtractResult.subdomain
) or convenience properties (e.g.ExtractResult.{fqdn,registered_domain}
).
- Add a 4th field
- Always include suffix if private suffix enabled and private suffix exists (#300)
This is the same content as version 3.6.0, originally released 2023-09-19, which was yanked.
- Bugfixes
- Honor private domains flag on
self
, not only when passed to__call__
(#289)
- Honor private domains flag on
- Bugfixes
- Speed up 10-15% over all inputs
- Refactor
suffix_index()
to use a trie (#285)
- Refactor
- Speed up 10-15% over all inputs
- Docs
- Adopt PEP257 doc style
- Bugfixes
- Bugfixes
- Docs
- Add FAQ about private domains
- Misc.
- Update bundled snapshot
- Fix lint in newer pylint
- Features
- Add method
extract_urllib
to extract from aurllib.parse.{ParseResult,SplitResult}
(#274)
- Add method
- Bugfixes
- Fix internal type-var error, in newer versions of mypy (#275)
- Bugfixes
- Fix documented types, in README and in exception message (#265)
- Misc.
- Format source code
- Features
- Bugfixes
- Handle more internationalized domain name dots (#253)
- Misc.
- Update bundled snapshot
- Add basic CLI test coverage
- Bugfixes
- Docs
- Fix docs with updated types
- Fix link in Travis CI badge (#248)
- Rewrite documentation intro
- Remove unnecessary subheading
- Unify case
- Features
- Add types to the public API (#244)
- Bugfixes
- Misc.
- Only run pylint in Tox environments, i.e. CI, not by default in tests (#230)
- Bugfixes
- Support Python 3.9
- Drop support for EOL Python 3.5
- Features
- Prefer to cache in XDG cache directory in user folder, vs. in Python install folder (#213)
- Bugfixes
- Fix
AttributeError
on--update
(#215)
- Fix
- Bugfixes
- Catch permission error when making cache dir, as well as cache file (#211)
- Bugfixes
No changes since 3.0.0.rc1.
This release fixes the long standing bug that public and private suffixes were generated separately and could not be switched at runtime, #66.
- Breaking Changes
- Rename
cache_file
tocache_dir
as it is no longer a single file but a directory (#207) - Rename CLI arg also, from
--cache_file
to--cache_dir
- Remove Python 2.7 support
- Rename
- Features
- Can pass
include_psl_private_domains
on call, not only on construction - Use filelocking to support multi-processing and multithreading environments
- Can pass
- Bugfixes
- Select public or private suffixes at runtime (#66)
- Removals
- Do not
debug
log the diff during update
- Do not
- Bugfixes
- Bugfixes
- Catch file not found
- Use pkgutil instead of pkg_resources (#163)
- Performance: avoid recomputes, a regex, and a partition
- Misc.
- Update LICENSE from GitHub template
- Fix warning about literal comparison
- Modernize testing (#177)
- Use the latest pylint that works in Python 2
- Appease pylint with the new rules
- Support Python 3.8-dev
- Bugfixes
- Features
- Add
cache_fetch_timeout
kwarg andTLDEXTRACT_CACHE_TIMEOUT
env var (#139)
- Add
- Bugfixes
- Bugfixes
- Switch to explicit Python version check (#124)
- Misc.
- Document public vs. private domains
- Document support for Python 3.6
- Bugfixes
- Relax required
requests
version: >= 2.1 (#98)
- Relax required
- Misc.
- Include tests in release source tarball (#97)
No changes since 2.0rc1.
This release focuses on shedding confusing code branches & deprecated cruft.
- Breaking Changes
- Renamed/changed the type of
TLDExtract
constructor paramsuffix_list_url
- It used to take a
str
or iterable. Its replacement,suffix_list_urls
only takes an iterable. This better communicates that it tries a sequence of URLs, in order. To only try 1 URL, pass an iterable with exactly 1 URLstr
.
- It used to take a
- Serialize the local cache of the remote PSL as JSON (no more
pickle
) - #81- This should be a transparent upgrade for most users.
- However, if you're configured to only read from your local cache file, no other sources or fallbacks, the new version will be unable to read the old cache format, and an error will be raised.
- Remove deprecated code
TLDExtract
'sfetch
param. To disable live HTTP requests for the latest PSL, instead passsuffix_list_urls=None
.ExtractResult.tld
property. UseExtractResult.suffix
instead.
- Moved code
- Split
tldextract.tldextract
into a few files.- The official public interface of this package comes via
import tldextract
. But if you were relying on direct import fromtldextract.tldextract
anyway, those imports may have moved. - You can run the package
python -m tldextract
for the same effect as the includedtldextract
console script. This used to bepython -m tldextract.tldextract
.
- The official public interface of this package comes via
- Split
- Renamed/changed the type of
- Misc.
- Bugfixes
- Support possible gzipped PSL response - #88
- Bugfixes
- Fix potential for
UnicodeEncodeError
with info log - #85
- Fix potential for
- Bugfixes
- Support IDNA2008 - #82
- Misc.
- Ease running scripts during local development
- Bugfixes
- Misc.
Fix publishing mistake with 1.7.0.
- Features
- Can include PSL's private domains on CLI with
--private_domains
boolean flag
- Can include PSL's private domains on CLI with
- Bugfixes
- Improved support for multiple Punycode (or Punycode-looking) parts of a URL
- Mixed in/valid
- Mixed encodings
- Fix
ExtractResult._asdict
on Python 3.4. This should also save space, as__dict__
is not created for eachExtractResult
instance.
- Improved support for multiple Punycode (or Punycode-looking) parts of a URL
- Features
- Pass
extra_suffixes
directly to constructor
- Pass
- Bugfixes
- Punycode URLs were returned decoded, rather than left alone
- Things that look like Punycode to tldextract, but aren't, shouldn't raise
- Print unified diff to debug log, rather than inconsistent stderr
- Bugfixes
- Missing setuptools dependency
- Avoid u'' literal for Python 3.0 - 3.2 compatibility. Tests will still fail though.
- Bugfixes
- Exclude PSL's private domains by default - #19
- This is a BREAKING bugfix if you relied on the PSL's private domains
- Revert to old behavior by setting
include_psl_private_domains=True
UnicodeError
for inputs that looked like an IP
- Exclude PSL's private domains by default - #19
- Features
- Support punycode inputs
- Bugfixes
- Fix minor Python 3 unicode errors
- Bugfixes
- Match PSL's GitHub mirror rename, from mozilla-central to gecko-dev
- Try Mozilla's PSL SPOT first, then the mirror
- Features
- Specify your own PSL url/file with
suffix_list_url
kwarg fallback_to_snapshot
kwarg - defaults to True
- Specify your own PSL url/file with
- Deprecations
fetch
kwarg
- Features
- Better CLI
- Cache env var support
- Python 3.3 support
- New aliases
suffix
andregistered_domain
- Bugfixes
- Fix dns root label
- Bugfixes
- Reliable logger name
- Forgotten
import sys