×

tldextract accurately separates a URL's subdomain, domain, and public suffix, using the Public Suffix List (PSL). Say you want just the "google" part of https://www.google.com. Everybody gets this wrong. Splitting on the "." and taking the 2nd-to-last element only works for simple domains, e.g. .com. Consider http://forums.bbc.co.uk: the naive splitting method will give you "co" as the domain, instead of "bbc". Rather than juggle TLDs, gTLDs, or ccTLDs yourself, tldextract extracts the currently living public suffixes according to the Public Suffix List. A public suffix is also sometimes called an effective TLD (eTLD).

Uploaded Tue Apr 1 00:31:49 2025
md5 checksum 29aaeec004f53019e51cad4b7a199484
arch x86_64
build py311h06a4308_0
depends filelock >=3.0.8, idna, python >=3.11,<3.12.0a0, requests >=2.1.0, requests-file >=1.4
license BSD-3-Clause
license_family BSD
md5 29aaeec004f53019e51cad4b7a199484
name tldextract
platform linux
sha1 a1149702fc35fc38bd8406bc1bf012e41f9258ab
sha256 d06b0927112d8ca7ac4584f7911ac78abca526cc192e5e33413498ba79b20595
size 126773
subdir linux-64
timestamp 1723064465971
version 5.1.2